public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: Unable to use "grep" command in VIM 7.4
Date: Tue, 16 Feb 2016 10:37:00 -0000	[thread overview]
Message-ID: <loom.20160216T110752-843@post.gmane.org> (raw)
In-Reply-To: <AM4PR01MB15381D43EB364F34622297DFADA90@AM4PR01MB1538.eurprd01.prod.exchangelabs.com>

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

      reply	other threads:[~2016-02-16 10:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-12 14:16 Unable able " Jeremy Leung
2016-02-16 10:37 ` Brian Inglis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20160216T110752-843@post.gmane.org \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).