Right now I am working on a file which uses many classes, methods, functions, variables, etc. Is it possible to go to the declaration of all of them? Please, take into account t
Setting up tags is not so difficult, though (as most things in Vim) it's not as automatic compared to IDEs.
ctags
tool. The most common today is Exuberant Ctags, found at ctags.sourceforge.net.tags
) for all the files in your project(s). This is usually done by running ctags -R .
from your project root (also from within Vim via :!ctags ...
). Exuberant Ctags support 41 languages, and you can even extend it via regular expressions.:set tags=./tags;
, it will search in the file's directory upwards to the root directory. If you have certain global include directories, you can add those.
and :tag
.You need to periodically update the tags database; there are plugins (like easytags.vim) that can do that automatically for you.