delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/02/16/05:37:21

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; q=dns; s=
default; b=CZUR1ABQTPbQf8nGD1ok+knGmjtAWL4GirC6kWQ3STHc5T90+YB1d
u9t3AxbIgssQhnFTsKIMnv019Uj90AbRF+3moR1PUV4+pio1T+XAagHbp6PNXGom
Qj18bOhS8bF1CJ33+eZbbhK1u5l8CdeGnu8fLT+AdKwoiUtKJ+eQF4=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; s=default;
bh=aZkqpWhl6PaxtW8SYZ3OQDfq9K8=; b=aYmMXkZJsBDl+67Ope2mp4jDvbCj
0wzIWNJftkdmtDk5+VvN5GOto0+H5fOmeJ+uQEkUNGefEuM9qwmCRu3/DbEYZtvn
QhabM6RYDFS4Dma+vhF240X6xxm/scYbYI2v7jDzX8AHNaVcV8yDF3cRJA67JFA9
IJ4K2hT44sXJTdI=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=mintty, UD:ac.uk, sxe, shq
X-HELO: plane.gmane.org
To: cygwin AT cygwin DOT com
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Subject: Re: Unable to use "grep" command in VIM 7.4
Date: Tue, 16 Feb 2016 10:35:46 +0000 (UTC)
Lines: 54
Message-ID: <loom.20160216T110752-843@post.gmane.org>
References: <AM4PR01MB15381D43EB364F34622297DFADA90 AT AM4PR01MB1538 DOT eurprd01 DOT prod DOT exchangelabs DOT com>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019