Ⅰ. 插件描述
CtrlP extension for fuzzy-search in tag matches (:tjump replacement).Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'ivalkeen/ctrlp-tjump'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'ivalkeen/ctrlp-tjump'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'ivalkeen/ctrlp-tjump'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/ivalkeen/vim-ctrlp-tjump
Ⅳ. 文档说明
# CtrlP tjump
CtrlP extension for fuzzy-search in tag matches.
May be used instead of :tjump or :tselect for IDE-like Goto declaration functionality,
which jumps to the declaration in case of one match, and shows quick-search window in case of multiple matches.
Two vim commands are created by this plugin:
CtrlPtjump- go to declaration of the identifier supplied as an argument, if not use the word under cursorCtrlPtjumpVisual- go to declaration of the visual selected text

Prerequisites
- CtrlP should be installed
- Tags should already work with
:tag,:tselectand:tjumpcommands. More information on that here.
Installation
- Use your favorite method (I prefer Vundle)
(Optional) Create mapping
nnoremap <c-]> :CtrlPtjump<cr> vnoremap <c-]> :CtrlPtjumpVisual<cr>
Basic Usage
- Move cursor to the Class/Method usage in your code
- Press
c-](if you have created mapping) or just execute:CtrlPtjump
(or:CtrlPtjumpVisualin visual mode) in the command line.
Or provide the symbol as an argument:
:CtrlPtjump MyFavoriteClass
Configuration
It is possible to configure shortener for filenames, that will be displayed in
CtrlP window. In the example below, RegExp '/home/.*/gems/' will be
substituted by string '.../'. This may be useful if filename (with path) of
generated tag is long and you want to make it shorter.
let g:ctrlp_tjump_shortener = ['/home/.*/gems/', '.../']
If there is only one tag found, it is possible to open it without opening CtrlP
window:
let g:ctrlp_tjump_only_silent = 1
The tag name itself takes valuable screen estate and can be disabled by:
let g:ctrlp_tjump_skip_tag_name = 1
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Added some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
Self-Promotion
If you like this project, please follow the repository on GitHub and vote for it on
vim.org. Also, you might consider visiting my blog and following me on Twitter and Github.