Generate ctags into central location for git super-projects and submodules, vim 'setlocal' helper combined with .git/hooks.
- Tiny. ~30LoC
- ctags generator as automatic custom git hooks
- Vim helper to set
tagswith project's central tag file
- Fast! Caches the project-path per tab
- Easy to hack and change
First, copy the custom git hooks to your template at
mkdir -p ~/.git_template/hooks cp contrib/hooks/* ~/.git_template/hooks
And set your
git config --global init.templatedir '~/.git_template'
Note: Git >=1.7.12 is in line with XDG, e.g.
Then install this vim plugin using your favorite plugin manager, or copy
tagabana.vim to your
.vim/plugin/ directory and start hacking.
git init, your template hooks will be copied into the new repository.
You can manually copy them into an existing git project. These hooks will
generate the ctags files in your
$XDG_CACHE_HOME/vim/tags/ folder every time
These git hooks will execute the main ctags generator script.
Ensure ~/.ctags Configuration
To set different ctags options, create yourself a
~/.ctags, I've included an
example at contrib/example.ctags
When you open Vim the plugin will try to detect the working-directory of the git super-project or submodule, and tells Vim to use the generated ctags file in the central location. This also happens after creating or reading a file. Note: The plugin caches the tags location per-tab, so mixing different project files in the same tab won't work as expected. You can easily change this behaviour to act per-buffer by hacking on tagabana.vim.
Options you can set in your
.vimrc to overwrite default behaviour.
||$XDG_CACHE_HOME/vim/tags/||Central directory for tags|
||0||Match submodules as well?|
Credits & Contribution
This plugin was developed by Rafael Bodill under the MIT License. Pull requests are welcome.