Alexandru Iancu wrote:
Hi,
I noticed that grep behaves differently in vim and gvim (both ran in Linux).
While using grep from vim I'm able to move between the results with
:cn/cp used from gvim the command gets replaced by something like:
!grep -n 'my_string_and_options_here' /dev/null ... | tee /tmp/...
The 'grepprg' has the same definition in both vim and gvim.
I searched in help but I can't understand why it is behaving like
this. I think it's cfg.
Are there any cfg files that gvim reads but vim doesn't?

Thanks,
Alexandru IANCU.


Starting with version 7, Vim has an "internal grep" command which IMHO is a Great (TM) feature: see ":help :vimgrep". It ought to work identically across all versions and platforms.

To see which scripts were sourced by the Vim you're currently using, use the ":scriptnames" command (q.v.). The prime culprit for things that gvim and vim do differently is the gvimrc (~/.gvimrc or ~/_gvimrc, if the one isn't found gvim looks for the other), but any script may use the ':if has("gui_running")' construct to discriminate between vim and gvim.

You may try ":map! cn" ":map! cN" or ":map! cp" to see if these have been remapped.

See
   :help :vimgrep
   :help :scriptnames
   :help has()
   :help feature-list      " then search down, /^gui_running
   :help :map
   :help map-overview


Best regards,
Tony.

Reply via email to