diff --git a/vim/plugin/ctags.vim b/vim/plugin/ctags.vim new file mode 100644 index 0000000..c5c2f9d --- /dev/null +++ b/vim/plugin/ctags.vim @@ -0,0 +1,15 @@ +" Exclude Javascript files in :Rtags via rails.vim due to warnings when parsing +let g:Tlist_Ctags_Cmd="ctags --exclude='*.js'" + +" Index ctags from any project, including those outside Rails +function! ReindexCtags() + let l:ctags_hook = '$(git rev-parse --show-toplevel)/.git/hooks/ctags' + + if exists(l:ctags_hook) + exec '!'. l:ctags_hook + else + exec "!ctags -R ." + endif +endfunction + +nmap ct :call ReindexCtags() diff --git a/vimrc b/vimrc index 396cc30..1db20ee 100644 --- a/vimrc +++ b/vimrc @@ -103,12 +103,6 @@ endfunction inoremap =InsertTabWrapper() inoremap -" Exclude Javascript files in :Rtags via rails.vim due to warnings when parsing -let g:Tlist_Ctags_Cmd="ctags --exclude='*.js'" - -" Index ctags from any project, including those outside Rails -map ct :!ctags -R . - " Switch between the last two files nnoremap