Ⅰ. 插件描述
vim plugin to make vimgrep friendlyⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'akira-hamada/friendly-grep-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'akira-hamada/friendly-grep-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'akira-hamada/friendly-grep-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/akira-hamada/friendly-grep.vim
Ⅳ. 文档说明
friendly-grep.vim
you can grep easily with this plugin.
Installation
if you use vundle, execute :BundleInstall after adding the following line into your .vimrc.
Bundle 'akira-hamada/friendly-grep.vim'or Download files and put them into your plugin and autoload directory.
How to Use
just execute the following command.
:FriendlyGrep
I recommend you add shortcut for the function into your .vimrc like this.
nnoremap <C-g> <ESC>:FriendlyGrep<CR>
Options
let g:friendlygrep_target_dir = 'path/to/dir/you/often/grep/'
" You can set directory path you grep friquently.
let g:friendlygrep_recursively = 1
" if you set this option 1, you can grep recursively always without a prompt for you.
" The default value is null (ask you recursive option everytime you grep)
let g:friendlygrep_display_result_in = 'tab'
" if you set 'tab' for this option, the plugin opens result in newtab.
" you can set 'split', 'vsplit' or 'quickfix' as value.
" The default value is 'split' (open results in top splited window)Vimgrep Tips
You might want to add the following shortcuts to jump around the grep result into your .vimrc.
nnoremap <LEFT> :cprevious<CR>
nnoremap <RIGHT> :cnext<CR>
nnoremap <UP> :<C-u>cfirst<CR>
nnoremap <DOWN> :<C-u>clast<CR>