修改vim使得cscope自動添加cscope.out

if has("cscope")
    set csprg=/usr/bin/cscope
    set csto=0
    set cst
    set csverb
    set cspc=3
    "add any database in current dir  
    if filereadable("cscope.out")
        cs add cscope.out
    "else search cscope.out elsewhere  
    else
       let cscope_file=findfile("cscope.out", ".;")
       let cscope_pre=matchstr(cscope_file, ".*/")
       if !empty(cscope_file) && filereadable(cscope_file)
           exe "cs add" cscope_file cscope_pre
       endif
     endif

endif

#quick start

nmap s :cs find s =expand("")
nmap g :cs find g =expand("")
nmap c :cs find c =expand("")
nmap t :cs find t =expand("")
nmap e :cs find e =expand("")
nmap f :cs find f =expand("")
nmap i :cs find i ^=expand("")$
nmap d :cs find d =expand("")

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章