Skip to content

Commit 1548f09

Browse files
author
Wizard Tai
committed
add load cscope.out file
1 parent da0701d commit 1548f09

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

_vimrc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@ set hls
1111

1212
"set foldlevel=99
1313

14-
set tags=./tags;,./gotags;,./.tags;,./.gotags;
14+
set tags=tags;/
15+
16+
function! LoadCscope()
17+
let db = findfile("cscope.out", ".;")
18+
if (!empty(db))
19+
let path = strpart(db, 0, match(db, "/cscope.out$"))
20+
set nocscopeverbose " suppress 'duplicate connection' error
21+
exe "cs add " . db . " " . path
22+
set cscopeverbose
23+
endif
24+
endfunction
25+
au BufEnter /* call LoadCscope()
1526

1627
nmap <F8> :TagbarToggle<CR>
1728

0 commit comments

Comments
 (0)