add the following text to .vimrc or .gvimrc:
if has("cscope") set csPRg=/usr/bin/cscope set csto=0 set cst set nocsverb " add any database in current directory if filereadable("cscope.out") cs add cscope.out " else add database pointed to by environment elseif $CSCOPE_DB != "" cs add $CSCOPE_DB endif set csverb endif
nmap <C-@>s :cs find s <C-R>=expand("<cWord>")<CR><CR>
nmap <C-@>g :cs find g <C-R>=expand("<cword>")<CR><CR>nmap <C-@>c :cs find c <C-R>=expand("<cword>")<CR><CR>nmap <C-@>t :cs find t <C-R>=expand("<cword>")<CR><CR>nmap <C-@>e :cs find e <C-R>=expand("<cword>")<CR><CR>nmap <C-@>f :cs find f <C-R>=expand("<cfile>")<CR><CR>nmap <C-@>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>nmap <C-@>d :cs find d <C-R>=expand("<cword>")<CR><CR>
當光標停在某個你要查找的詞上時, 按下<C-_>g, 就是查找該對象的定義, 其他的同理. 按這種組合鍵有一點技巧,按了<C-_>后要馬上按下一個鍵,否則屏幕一閃就回到nomal狀態了 <C-_>g的按法是先按"Ctrl+Shift+-", 然后很快再按"s"
新聞熱點
疑難解答
圖片精選