在source insight中想必大家很习惯预览功能了,现在就给大家带来一个这样的vim插件,我刚实验了一下,效果非常好。
1.yaourt -S vim-srcexpl
2.在.vimrc中添加如下内容:
" // The switch of the Source Explorer
nmap
:SrcExplToggle
" // Set the height of Source Explorer window
let g:SrcExpl_winHeight = 8
" // Set 100 ms for refreshing the Source Explorer
let g:SrcExpl_refreshTime = 100
" // Set "Enter" key to jump into the exact definition context
" let g:SrcExpl_jumpKey = ""
" // Set "Space" key for back from the definition context
let g:SrcExpl_gobackKey = ""
" // In order to Avoid conflicts, the Source Explorer should know what plugins
" // are using buffers. And you need add their bufname into the list below
" // according to the command ":buffers!"
let g:SrcExpl_pluginList = [
\ "__Tag_List__",
\ "_NERD_tree_",
\ "Source_Explorer"
\ ]
" // Enable/Disable the local definition searching, and note that this is not
" // guaranteed to work, the Source Explorer doesn't check the syntax for now.
" // It only searches for a match with the keyword according to command 'gd'
let g:SrcExpl_searchLocalDef = 1
" // Do not let the Source Explorer update the tags file when opening
let g:SrcExpl_isUpdateTags = 0
" // Use 'Exuberant Ctags' with '--sort=foldcase -R .' or '-L cscope.files' to
" // create/update a tags file
let g:SrcExpl_updateTagsCmd = "ctags --sort=foldcase -R ."
" // Set "" key for updating the tags file artificially
let g:SrcExpl_updateTagsKey = ""
3.简单解释下用法,启动vim,用F8快捷键打开或者关闭预览窗口 回车跳转到定义的文本,空格跳转回来
最终效果如图:
阅读(10413) | 评论(0) | 转发(0) |