Re: arguments to map commands
- "Janakiraman .S" wrote:
>Another option is
> * Sandip Solanki (sandip@...) wrote thusly :
> > But I think my question is misinterpreted.
> > My requirement is, I want to run a shell script from vim which requires
> > arguments and output I want to insert in file.
> > I use map alw in insert mode as
> > :map! alw <Esc>:r !proc.csh
> > proc.csh requires argument.
> > Now depends upon arguments output may differ. Above mapping works but the cursor
> > comes on command line and take argument, again after applying arguments and
> > enter it's not continued with insert mode. Which I dont want.
> > So, I want to supply arguments with mapped key which further processed and
> > output placed in file and I continues with insert mode.
> Something like
> :imap alw <c-o>:r!proc.csh
> might do it for you.
> :he imap
> :he i_CTRL-O
:imap alw <Esc>:call Alw()<CR>
let x = input("prompt for x:")
r !proc.csh x y z
I have not tested this, but I think that the :startinsert should work to
return you to Insert mode when the function finishes.
HTH --Benji Fisher