[Vim-latex-devel] Re: Some problems with command implementation
Brought to you by:
srinathava,
tmaas
From: Luc H. <her...@fr...> - 2002-12-27 23:27:21
|
* On Fri, Dec 27, 2002 at 01:06:32AM -0800, Srinath Avadhanula <sr...@fa...> wrote: > I am facing a problem implementing some commands in templates.vim, > packages.vim and custommacros.vim... I have as an example, the > following setup: > > ---------------------%<--------------------- > inoremap <F3> <C-r>=Foo()<CR> > nnoremap <F3> i<C-r>=Foo()<CR> > com! -nargs=? FooCom normal! i<C-r>=Foo()<CR> > ---------------------%<--------------------- > > However, when FooCom is called without any arguments, we end up always > getting a value 'bozo' for name because the <CR> gets eaten up by the > input() immediately (I think). Whats a good way to make the command > work? I tried placing a ":call getchar()" at the beginning of the > function but even then the command without argument doesn't work... I remember I add a similar problem sometimes ago. Unfortunately, I don't remember how I solved it, or if I solved it. I wonder if I didn't give up to finally call :normal from the function... And I guess that: command! -nargs=? FooCom :normal <F3> does not solve your problem ? -- Luc Hermitte http://hermitte.free.fr/vim/ |