- Notifications
You must be signed in to change notification settings - Fork175
A Vim plugin that manages your tag files
License
ludovicchabant/vim-gutentags
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Gutentags is a plugin that takes care of the much needed management of tagsfiles in Vim. It will (re)generate tag files as you work while stayingcompletely out of your way. It will even do its best to keep those tag filesout of your way too. It has no dependencies and just works.
Install Gutentags like any other Vim plugin. I recommend something likePathogen, so you can go:
cd ~/.vim/bundlehg clone https://bitbucket.org/ludovicchabant/vim-gutentagsIf you're more into Git than Mercurial:
git clone https://github.com/ludovicchabant/vim-gutentags.gitThen you only need to do a:call pathogen#helptags() to generate thedocumentation tags (how ironic, eh?) and you can access Gutentags' help pageswithhelp gutentags.
In order to generate tag files, Gutentags will have to figure out what's inyour project. To do this, it will locate well-known project root markers likeSCM folders (.git,.hg, etc.), any custom tags you define (withgutentags_project_root), and even things you may have defined already withother plugins, likeCtrlP.
If the current file you're editing is found to be in such a project, Gutentagswill make sure the tag file for that project is up to date. Then, as you workin files in that project, it will partially re-generate the tag file. Everytime you save, it will silently, in the background, update the tags for thatfile.
Usually, ctags can only append tags to an existing tag file, so Gutentagsremoves the tags for the current file first, to make sure the tag file isalways consistent with the source code.
Also, Gutentags is clever enough to not stumble upon itself by triggeringmultiple ctags processes if you save files too fast, or your project is reallybig.
There are some similar Vim plugins out there ("vim-tags", "vim-autotag","vim-automatic-ctags", etc.). They all fail on one or more of the requirementsI set for myself with Gutentags:
- No other dependency than running Vim: no Python, Ruby, or whatever.
- Cross-platform: should work on at least Ubuntu, Mac, and Windows.
- Incremental tags generation: don't re-generate the whole project all the time.This may be fine for small projects, but it doesn't scale.
- External process management: if the ctags process is taking a long time, don'trun another one because I saved a file again.
- Keep the tag file consistent: don't just append the current file's tags to thetag file, otherwise you will still "see" tags for deleted or renamed classesand functions.
- Automatically create the tag file: you open something from a freshly forkedproject, it should start indexing it automatically, just like in Sublime Textor Visual Studio or any other IDE.
I hope Gutentags will bring you as much closure as me regarding tag files. I knowI don't want to have to think about it, and probably neither do you.
- gutentags_plus: handlesswitching between
cscopedatabases automatically before performing a searchquery.
About
A Vim plugin that manages your tag files
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.