I’m just getting acquainted with Vim’s CTags functionality – and it’s damn handy.
One issue I have, though, is regenerating common tags for each project.
For example – I do a fair bit of work in rails, and like to generate ctags for the whole rails framework with
alias rctags="ctags -R `bundle show rails`/../*"
The issue is I have to do this for every rails project I start up.
So, what’s the standard way to automatically access a set of tags in any vim session – ideally only if the opened file satisfies a specific condition. (Eg rails ctags preloaded for .rb files, but not .py files)
Any ideas appreciated
See
:help 'tags'.You could use, for example:
Which would cause
~/.rails-tagsto be searched for tags.(also, on the topic of tags: it’s probably useful to suffix the
tagsvariable with;/. This means “search for a tags file in every parent of the working directory (ex, all the files/foo/bar/tags,/foo/tags, and/tagswill be searched. For example, I use:set tags=tags;/).