On 2008-12-09, Steven Woody wrote:
> Hi,
> 
> I know use '|' and combine two command,  but I don't know how to do
> the combination when the first command is a external shell command
> (prefixed by a '!').
> 
> For example, I want to define <F5> to run a shell command which
> updates my cscope database and then run ':cs reset', I tried
> 
> nmap <F5> :!./recs-sh | :cs reset<CR>
> 
> but it failed.
> 
> Anyone can be kindly help?

The :execute command can help here.

   nmap <F5> :exe '!./recs-sh' | cs reset<CR>

Note that the colon is needed only at the start of the command line, 
not in front of each command.

See

   :help :exe

Regards,
Gary


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to