diff options
author | Hugues Hiegel <hugues.hiegel@qosmos.com> | 2014-01-24 12:17:22 +0100 |
---|---|---|
committer | Hugues Hiegel <hugues.hiegel@qosmos.com> | 2014-01-24 12:17:22 +0100 |
commit | 7c53ba40f726f000c42b5b39dce146eaf56fa277 (patch) | |
tree | 1c321f98b429d6ffc01576819d8d4fd5078d3546 | |
parent | a54dbe4fd92e1a7c5df05fcefcac4bb1008f0b0b (diff) |
[Tags] always loads cscope bindings, to allow future « cs add ... »
-rw-r--r-- | vimrc | 32 |
1 files changed, 17 insertions, 15 deletions
@@ -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 |