代码: 全选
2009-02-19 12:12:03 四 ~/.vim/plugin
☎ cat cscopemenu-exp.vim
" Add_Cscope_Menu
" Adds a cscope menu
" All the commands work on the word that is under the cursor
function! s:Add_CScope_Menu(menu_clear)
if has("gui_running")
if (a:menu_clear)
silent! unmenu &Cscope
silent! unmenu! &Cscope
amenu <silent> &Cscope.查找调用本函数的函数 :cs find c <C-R>=expand("<cword>") <CR><CR>
amenu <silent> &Cscope.查找本函数调用的函数 :cs find d <C-R>=expand("<cword>") <CR><CR>
amenu <silent> &Cscope.查找egrep模式 :cs find e <C-R>=expand("<cword>") <CR><CR>
amenu <silent> &Cscope.查找并打开文件 :cs find f <C-R>=expand("<cword>") <CR><CR>
amenu <silent> &Cscope.查找函数、宏、枚举等定义的位置 :cs find g <C-R>=expand("<cword>") <CR><CR>
amenu <silent> &Cscope.查找包含本文件的#including文件 :cs find i <C-R>=expand("<cfile>") <CR><CR>
amenu <silent> &Cscope.查找C语言符号 :cs find s <C-R>=expand("<cword>") <CR><CR>
amenu <silent> &Cscope.查找指定的字符串 :cs find t <C-R>=expand("<cword>") <CR><CR>
endif
endif
endfunction
autocmd BufEnter * call s:Add_CScope_Menu(1)
E567: 没有 cscope 连接