VIM: updating ctags file automatically

Most VIM developers use ctags for browsing the code. It is quite annoying to refresh the tags manually though. I forget to do this all the time – and suddenly navigation breaks.

Recently I have stumbled upon a great VIM plugin, simple and brilliant: AutoTag, http://www.vim.org/scripts/script.php?script_id=1343. This little thing updates your tags automatically on each buffer save. Just try it – you won’t go back, I promise! :)

I would suggest one small tweak to correct the plugin issue (which I believe will be fixed soon by it’s author). After having enabling the plugin I started to receive annoying messages containing ctags console output. I had to press “ENTER” each time to continue editing. To get rid of these messages simply change the line in autotag.vim:
autocmd BufWritePost,FileWritePost * call AutoTag ()
to
autocmd BufWritePost,FileWritePost * silent call AutoTag ().

If you are curious about silent:help silent :) .


Explore posts in the same categories: Vim

Comment: