.vimrc: .cscope recursive search
This commit is contained in:
parent
1d514c7bd1
commit
6e92c39edf
8
.vimrc
8
.vimrc
|
@ -151,8 +151,9 @@ function! ToggleMyFontSize()
|
||||||
endfunction
|
endfunction
|
||||||
nnoremap <silent> <F12> :call ToggleMyFontSize()<CR>
|
nnoremap <silent> <F12> :call ToggleMyFontSize()<CR>
|
||||||
|
|
||||||
" ctags
|
" ctags/cscope
|
||||||
let local_tags = ".ctags"
|
let local_tags = ".ctags"
|
||||||
|
let local_cscope = ".cscope.out"
|
||||||
let local_path = "/"
|
let local_path = "/"
|
||||||
let current_path = getcwd()
|
let current_path = getcwd()
|
||||||
" If the current path is a child of $HOME directory, start from $HOME
|
" If the current path is a child of $HOME directory, start from $HOME
|
||||||
|
@ -166,8 +167,11 @@ for path_part in path_parts
|
||||||
if filereadable(local_path . local_tags)
|
if filereadable(local_path . local_tags)
|
||||||
exe ":set tags+=" . local_path . local_tags
|
exe ":set tags+=" . local_path . local_tags
|
||||||
endif
|
endif
|
||||||
|
if filereadable(local_path . local_cscope)
|
||||||
|
exe "cs add" local_path . local_cscope
|
||||||
|
endif
|
||||||
endfor
|
endfor
|
||||||
unlet local_tags local_path current_path path_parts
|
unlet local_tags local_cscope local_path current_path path_parts
|
||||||
|
|
||||||
map <F4> [I:let nr = input("Which one: ")<Bar>exe "normal " . nr ."[\t"<CR>
|
map <F4> [I:let nr = input("Which one: ")<Bar>exe "normal " . nr ."[\t"<CR>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue