Mercurial > public > dotfiles
diff vim/.vimrc @ 21:083b3c7ae8c0
Update ctags generation.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 18 Dec 2014 20:24:45 -0600 |
parents | 33114558b770 |
children | 4408beef769d |
line wrap: on
line diff
--- a/vim/.vimrc Thu Dec 18 18:34:02 2014 -0600 +++ b/vim/.vimrc Thu Dec 18 20:24:45 2014 -0600 @@ -67,18 +67,26 @@ " ctags support function BgnCtags() - let d = fnamemodify(findfile("root.dir", ";"), ":p:h") - let tags = d . "\\tags" - let s = "ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --exclude=Coe_prune --exclude=Opnet --languages=-all --languages=+c,c++,python -f " . tags . " " . d - echo s - call system(s) + let s:d = finddir(".hg", ";") + if s:d == "" + let s:d = finddir(".git", ";") + endif + if s:d == "" + echo "No root directory found" + return + endif + let s:path = fnamemodify(s:d, ":p:h:h") + let s:tags = s:path . "/.tags" + let s:cmd = "ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --languages=-all --languages=+c,c++,python,actionscript -f " . s:tags . " " . s:path + echo s:cmd + call system(s:cmd) endfunction -nnoremap <F8> :call BgnCtags()<CR> -nnoremap <F9> :tn<CR> -nnoremap <F10> :tp<CR> -nnoremap <F11> :tj<CR> -set tags=tags;/ +nnoremap <leader>c :call BgnCtags()<CR> +"nnoremap <F9> :tn<CR> +"nnoremap <F10> :tp<CR> +"nnoremap <F11> :tj<CR> +set tags=.tags;/ " Trial settings set wildmenu