You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
config/nvim/conf.d/cscope.vim

26 lines
883 B

set cst
set csre
"list of reference
nmap <unique> <C-s>s :cs find s <C-R>=expand("<cword>")<CR><CR>
"definition
nmap <unique> <C-s>g :cs find g <C-R>=expand("<cword>")<CR><CR>
"call
nmap <unique> <C-s>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <unique> <C-s>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <unique> <C-s>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <unique> <C-s>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <unique> <C-s>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <unique> <C-s>d :cs find d <C-R>=expand("<cword>")<CR><CR>
function! LoadCscope()
let db = findfile("cscope.out", ".;")
if (!empty(db))
let path = strpart(db, 0, match(db, "/cscope.out$"))
set nocscopeverbose " suppress 'duplicate connection' error
exe "cs add " . db . " " . path
set cscopeverbose
endif
endfunction
au BufEnter /* call LoadCscope()