Tuesday, December 15, 2009

Re: How to control the behavior acted by vim after searching in files with grep ?

Thank you very much, it solves my problem !

2009/12/16 Matt Wozniski <mjw@drexel.edu>
On Tue, Dec 15, 2009 at 9:05 PM, Lenin Lee wrote:
> Hi there,
> I used grep to search in files, but vim always opens the first matching
> file.
> I wonder how to control this behavior, is there a way to stop opening a
> match automatically

Use the ! flag.

   :grep! foo *.c

> or open it in a new split window ?

Split the window before doing the search:

   :split | grep foo *.c

~Matt

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php



--
初从文,三年不第。遂习武,校场发一矢,中鼓吏,逐之出。后学医,有所成,自撰一良方,服之,卒。

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments: