Ⅰ. 插件描述
Show all lines in the buffer containing word (grep buffer)Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/occur-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/occur-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/occur-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/occur.vim
Ⅳ. 文档说明
This script looks like 'occur' of emacs script.
Create a quickfix list using all lines in the buffer containing a match for regexp.
Search for regexp in the current buffer or all buffers.
Search current buffer:
(1) Search the word by '/' command.
(2) :Occur
Search all buffers:
(1) Search the word by '/' command.
(2) :Moccur
Seach all buffers for occurrence of the word nearest to the cursor:
(1) move the cursor to the word
(2) :StarOccur
You can use keymappings of
<Leader>oc - Occur
<Leader>mo - Moccur
<Leader>* - StarOccur
The default <Leader> is backslash. (ex: * = StarOccur)
(see :help mapleader)
[QUICKFIX KEY-MAPPING]
This plugin enhances quickfix key-mapping.
(when this plugin opens the quickfix window.)
<Space> : Set current window height to highest.
x : Display the occurence the current line.
q : Quit the quickfix window.
If you want to disable this, then you can set the variable in the "vimrc".
let g:occur_no_quickfix_map = 1