Ⅰ. 插件描述
(Neo)Vim plugin for searching useful variable namesⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'voldikss/vim-codelf'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'voldikss/vim-codelf'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'voldikss/vim-codelf'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/voldikss/vim-codelf
Ⅳ. 文档说明
# vim-codelf
(Neo)Vim plugin for searching useful variable names from CODELF
<div align="center">
<img src="https://user-images.githubusercontent.com/20282795/71583991-a2acda00-2b4b-11ea-99aa-097762e92383.gif" width=900></div>
<div align="center">
<img src="https://user-images.githubusercontent.com/20282795/71583992-a2acda00-2b4b-11ea-8f72-1d0068b020ff.gif" width=900></div>
Install
Plug 'voldikss/vim-codelf'Keymap
" Example key mappings configuration
inoremap <silent> <F9> <C-R>=codelf#start()<CR>
nnoremap <silent> <F9> :call codelf#start()<CR>Configuration
g:codelf_enable_popup_menu
If set v:true, the available variable names will displayed in popup menu, which behaviors just like code completion.
Otherwise, they will be displayed in cmdline, prompting the user to select one(like :z=) to replace the word under the cursor.
Commands
:Codelf [word]
Query the word from codelf, return the variable name.
:CodelfOpenBrowser [word]
Statusline
g:codelf_status
Open browser with querying the word. If no word, use the word under the cursor. My another plugin vim-browser-search supplies the same function.
Q&As
- How to stop it from displaying after triggering a codelf query?
If the cursor was moved to another place, the callback function will be disabled.
- Will it frozen my Vim?
If your (Neo)Vim has job feature, this plugin won't stop your behavior. Otherwise, yes(and this plugin is not recommended in that case).