This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Unable to use "grep" command in VIM 7.4


Jeremy Leung <Leung-J2 <at> email.ulster.ac.uk> writes:
> I have recently installed the latest version of Cygwin on my Windows 8
laptop, and everything is working as expected.
> However the issue I am having is that when I'm in VIM, and try to use the
":grep" command, it says that the
> command is not available in this version.
> Why is this the case when I can use grep outside of VIM with no issues,
and how could I solve this?

Have you updated cygwin base and vim recently? 

In cygwin mintty window type 
  which vim
and check output is:
  /usr/bin/vim

In cygwin mintty window type 
  vim

In vim type:
  :!which grep
and check you get:
  /usr/bin/grep

In vim type:
  :version
and check +quickfix is included not -quickfix. 

In vim type:
  :set grepprg? grepformat?
and check these look like: 
  grepprg=grep -n $* /dev/null
  grepformat=%f:%l:%m,%f:%l%m,%f  %l%m
You might have to change grepprg in your ~/.vimrc to 
  :set grepprg=grep -n "$@" /dev/null
to handle spaces in arguments properly or type "\ " instead of " ".

In vim type:
  :set sh? shq? sxq? sxe? shcf? srr? stmp?
and check these look like: 
  shell=/bin/bash
  shellquote=
  shellxquote=
  shellxescape=
  shellcmdflag=-c
  shellredir=>%s 2>&1
  shelltemp

In vim type your grep command and post that from : and the output for more
help. 

You might also want to try vim ":help grep" and use ":vim" aka ":vim[grep]"
instead of ":grep" for searching external files. 



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]