On 2009-11-18, Peng Yu wrote:
> On Nov 18, 1:55 am, Gary Johnson <[email protected]> wrote:
> > A third way, that uses both the temporary file and the quickfix
> > list, is to open your temporary file like this:
> >
> > gvim --cmd 'let &efm=&gfm' -q /tmp/grep_output.txt
>
> I want to start with gvim as if ':cope' is typed. Would you please let
> me know how to modify the above command?
Sure. I was going to suggest this:
gvim --cmd 'let &efm=&gfm' -c cope -q /tmp/grep_output.txt
However, it turns out that when you do that, the cursor is put in
the top window, the one containing the first file in the quickfix
list, rather than in the quickfix window. Adding "-c 'wincmd w'" or
"-c 'wincmd j'" doesn't change this.
So, if you want the behavior to be as though ":cope" was typed, use
this command instead:
vim --cmd 'let &efm=&gfm' -c 'cf /tmp/grep.out' -c cope
See
:help -c
:help --cmd
Regards,
Gary
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---