rgrep.vim


Ⅰ. 插件描述

Vim plugin for Recursive Grep

Ⅱ. 基本信息

创建日期:  2009-01-20
使用用户:  4
Github星:  6
插件作者:  Rodrigo Rosenfeld Rosas

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'rosenfeld/rgrep-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'rosenfeld/rgrep-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'rosenfeld/rgrep-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/rosenfeld/rgrep.vim

Ⅳ. 文档说明

# rgrep.vim #

Inspired by ack.vim, but works with grep instead of ack.

Setup

It is intended to be used with this:

set grepprg=grep\ -nrI\ --exclude-dir=target\ --exclude-dir=tmp\ --exclude-dir=log\ --exclude="*.min.js"\ --exclude="*.log"\ $*\ /dev/null

You can choose whatever arguments you like for grep.

Usage

:RGrep [options] [{pattern} {directory}]

Search recursively in {directory} for the {pattern}. If {pattern} is not given,
it will look for the word under cursor for all files, recursively.

Files containing the search term will be listed in the split window, along with
the line number of the occurrence, once for each occurrence. [Enter] on a line
in this window will open the file, and place the cursor on the matching line.

Just like where you use :grep, :grepadd, :lgrep, and :lgrepadd, you can use :RGrep, :RGrepAdd, :LRGrep, and :LRGrepAdd respectively. (See doc/rgrep.txt, or install and :h RGrep for more information.)

Keyboard Shortcuts

In the quickfix window, you can use:

o    to open (same as enter)
go   to preview file (open but maintain focus on rgrep.vim results)
t    to open in new tab
T    to open in new tab silently
v    to open in vertical split
gv   to open in vertical split silently
q    to close the quickfix window

This Vim plugin is derived from ack.vim.

Bitdeli Badge

添加新评论