sherlock.vim


Ⅰ. 插件描述

Add completion in command line for '/', '?' and ':.../'

Ⅱ. 基本信息

创建日期:  2009-08-07
使用用户:  4
Github星:  2
插件作者:  Frederic Hardy

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

sherlock.vim add completion from current buffer for command line mode ':' after a '/', and in command line mode '/' and '?'.

By default, it use <C-Tab> for forward completion, and <C-S-Tab> for backward completion.

For example:
:%s/tes<C-Tab> list all word which begin with 'tes' after current cursor position;
:%s/tes<C-S-Tab> list all word which begin with 'tes' before current cursor position;
/tes<C-Tab> list all word which begin with 'tes' after current cursor position;
/tes<C-S-Tab> list all word which begin with 'tes' before current cursor position;
?tes<C-Tab> list all word which begin with 'tes' after current cursor position;
?tes<C-S-Tab> list all word which begin with 'tes' before current cursor position;

In ':' mode, completion is available only after a '/'.

When the right string is in command line, you can:
1) Validate it with <Enter>, or type <Esc> to go away from command line if you are in '?' or '/' mode;
2) Validate it with <Enter> or '/', or type <Esc> to go away from command line if you are in ':' mode.

You can override the default mapping with something like that in your .vimrc:
cnoremap <Whatever you want here> <C->esherlock#completeBackward()<CR>
cnoremap <Whatever you want here> <C->esherlock#completeForward()<CR>

You can disable this plugin with this line in your .vimrc:
let sherlock#disable = 1

Please, report any bug to sherlock.vim[..at..]mageekbox.net.

添加新评论