If you use ctags to make tags files of your source, it's nice to be able to re-run ctags on a source file when you save it.
ctags -a will only change existing entries in a tags file or add new ones. It doesn't delete entries that no longer exist. Should you delete an entity from your source file that's represented by an entry in a tags file, that entry will remain after calling
This python function will do two things:
It will search for a tags file starting in the directory where your source file resides and moving up a directory at a time until it either finds one or runs out of directories to try.
Should it find a tags file, it will then delete all entries in said tags file referencing the source file you've just saved and then execute
ctags -aon that source file using the relative path to the source file from the tags file.
This way, every time you save a file, your tags file will be seamlessly updated.
Currently I suggest you use Vundle and install as a normal Bundle
From the Vim command-line
And add to your ~/.vimrc
Or you can manually install cd git clone git://github.com/craigemery/vim-autotag.git cd ~/.vim/ mkdir -p plugin cp ~/vim-autotag.git/plugin/autotag.vim plugin/
Install as a Pathogen bundle
git clone git://github.com/craigemery/vim-autotag.git ~/.vim/bundle/vim-autotag
Autotag can be configured using the following global variables:
||a cap on what size tag file to strip etc|
||suffixes to not ctags on|
||logging verbosity (as in Python logging module)|
||name of ctags command|
||name of tags file to look for|
||Disable autotag (enable by setting to any non-blank value)|
||stop looking for a tags file (and make one) at this directory (defaults to $HOME)|
Copyright (c) Craig Emery. Distributed under the same terms as Vim itself.