This functionality allows one to jump between files to locate subroutines.
Edit the file using vi.
In all cases you will be entered into the correct file and the cursor will be positioned at the subroutine desired.
If it is not working properly look at the "tags" file created by ctags. Also the tag name (first column) may be abbreviated for convenience. One may shorten the significant characters using :set taglength=number
Tag Notes:
vim tagging notes: (These specific tag features not available in vi)
Tag Command | Description |
---|---|
:tag start-of-tag-name_TAB | Vim supports tag name completion. Start the typing the tag name and then type the TAB key and name completion will complete the tag name for you. |
:tag /search-string | Jump to a tag name found by a search. |
ctrl-] | The vim editor will jump into the tag to follow it to a new position in the file or to a new file. |
ctrl-t | The vim editor will allow the user to jump back a level. (or :pop) |
:tselect | When multiple entries exist in the tags file, such as a function declaration in a header file and a function definition (the function itself), the operator can choose by issuing this command. The user will be presented with all the references to the function and the user will be prompted to enter the number associated with the appropriate one. |
:tnext | When multiple answers are available you can go to the next answer. |
:set ignorecase (or :set ic) | The ignore case directive affects tagging. |
:tags | Show tag stack (history) |
:4pop | Jump to a particular position in the tag stack (history). (jump to the 4th from bottom of tag stack (history). The command ":pop" will move by default "1" backwards in the stack (history).) or :4tag (jump to the 4th from top of tag stack) |
:tnext | Jump to next matching tag. (Also short form :tn and jump two :2tnext) |
:tprevious | Jump to previous matching tag. (Also short form :tp and jump two :2tp) |
:tfirst | Jump to first matching tag. (Also short form :tf, :trewind, :tr) |
:tlast | Jump to last matching tag. (Also short form :tl) |
:set tags=./tags,./subdir/tags | Using multiple tag files (one in each directory). Allows one to specify all tags files in directory tree: set tags=src/**/tags Use Makefile to generate tags files as well as compile in each directory. |