summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues.hiegel@qosmos.com>2014-01-24 12:17:22 +0100
committerHugues Hiegel <hugues.hiegel@qosmos.com>2014-01-24 12:17:22 +0100
commit7c53ba40f726f000c42b5b39dce146eaf56fa277 (patch)
tree1c321f98b429d6ffc01576819d8d4fd5078d3546
parenta54dbe4fd92e1a7c5df05fcefcac4bb1008f0b0b (diff)
[Tags] always loads cscope bindings, to allow future « cs add ... »
-rw-r--r--vimrc32
1 files changed, 17 insertions, 15 deletions
diff --git a/vimrc b/vimrc
index 130ebca..f6b4d61 100644
--- a/vimrc
+++ b/vimrc
@@ -118,16 +118,18 @@ function! CscopeSearch(csearch)
return 'set hls | cscope find '.l:ctype.' '.a:csearch
endfunction
-" Load local cscope db if exists
-if filereadable( expand("$PWD/tags") )
- set tags=tags
-elseif filereadable( expand("$PWD/ctags.out") )
- set tags=$pwd/ctags.out
-elseif has("cscope")
- if filereadable( expand("$PWD/cscope.out") )
- set cst
-
- " Automagically done...
+function! LoadTags()
+ " Load local cscope db if exists
+ if filereadable( expand("$PWD/tags") )
+ set tags=tags
+ elseif filereadable( expand("$PWD/ctags.out") )
+ set tags=$pwd/ctags.out
+ elseif has("cscope")
+ if filereadable( expand("$PWD/cscope.out") )
+ set cst
+ endif
+
+ " Automagically done...
"cscope add $PWD/cscope.out
" cscope macros
@@ -142,14 +144,14 @@ elseif has("cscope")
nmap <ESC>F :execute CscopeSearch(expand("<cfile>"))<CR>
nmap <ESC>f :cs find f <cfile><CR>
- " search files #including current file
- "nmap <ESC>% :execute CscopeSearch(expand("%:t"))<CR>
- nmap <ESC>% :cs find i %:t<CR>
+ " search current file
+ nmap <ESC>% :execute CscopeSearch(expand("%:t"))<CR>
+ "nmap <ESC>% :cs find i %:t<CR>
nmap <ESC>r :execute CscopeSearch(input("Rechercher : "))<CR>
endif
-endif
-
+endfunction
+call LoadTags()
" F*cking whitespaces
autocmd BufRead * highlight ExtraWhitespace ctermbg=red ctermfg=black guibg=red