First, run ctags --version
. If it says something about “etags” or “emacs”, do:
$ sudo apt-get install exuberant-ctags
Include this in our .vimrc:
set tags=./tags,tags;$HOME
Generate tags:
$ cd myproject
$ ctags -R .
We may want to add ctags to our Makefile.
In vim, when the cursor is on a function name, for example, do CTRL-] to jump to the function definition. Do CTRL-t to jump back.