- It is a programming tool that generates index file of names found is source and header file.
- It is used in many programming languages.
- Functions, variables, class names, structures, macros are indexed, but what all names can be indexed depends on the programming language.
- Most commonly used ctags with vim editor is Exuberant Ctags.
Useful Commands
- To enable ctags in a source file give the command ctags -R *
- It parses all the names and creates a stack for each name.
- To view the definition of a function or a structure we need to take our cursor over it and enter ctrl+] command.
- To come back to fucntion call from definition we use ctrl+t.
- Following vim commands can be used to navigate through relevant functions
:tsor:tselectshows the list:tnor:tnextgoes to the next tag in that list:tpor:tprevgoes to the previous tag in that list:tfor:tfirstgoes to the first tag of the list:tlor:tlastgoes to the last tag of the list