Wednesday, September 1, 2010

RE: Forcing Vim to use findstr as 'grepprg' on Windows

Kyro El wrote:
> I have trouble forcing Vim to use findstr /N as grepprg on
> Windows. I don't know what tricks does Vim do under the hood,
> but my grepprg is set to 'grep -nH $*' by default. However,
> while I do have a copy of grep in my path, it doesn't support
> the '-H' option.
>
> I then put 'set grepprg=findstr\ /N' in my path. But I still
> got 'grep -nH $*' then vim is brough up.

By "in my path" you probably mean "in my vimrc". At any rate,
start Vim and enter command:

:verbose set grepprg?

That reports the current value and where it was set.

If it says 'findstr /n' that is the command string that will be
used for :grep.

At command prompt (not Vim), you could run findstr to verify
that it is running the standard Windows program (i.e. that you
do not have something with the same name that is interfering).

John

--
You received this message from the "vim_use" 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

No comments: