On Jun 16, 7:26 pm, SungHyun Nam <[email protected]> wrote:
> Hello,
>
> I tested it with vim-6.3.82 and vim-7.3beta.
> And run vim as:
>    git grep code | vim -u NONE --noplugin -
>
> 'gf' opens a file for the line below:
>      somedir/somefile.c:  code...
>      somedir/somefile.c:#include code...
>      somedir/somefile.c:/* code...
>
> But, 'gf' generates error for the line below:
>      somedir/somefile.c://#include code...
>
> The error message is:
>      E447: Can't find file "somedir/somefile.c://#include" in path
>
> It seems '://' pattern caused problem.
>

The 'gf' command opens the file under the cursor, where it gets the
file name from all characters under the cursor that are in 'isfname'.

Your problem, is ':' is in 'isfname' (and for good reason). You can
either temporarily set isfname-=: before doing your gf, or (as I would
recommend) you could change your 'grepprg' option within Vim to allow
you to do your git grep command from *within* Vim, allowing Vim to
parse the results into your quickfix list.

See http://vim.wikia.com/wiki/Find_in_files_within_Vim

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui