Showing posts with label ctags. Show all posts
Showing posts with label ctags. Show all posts

Saturday, November 8, 2014

Explain the usage of ctags.

  • 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
  • :ts or :tselect shows the list
  • :tn or :tnext goes to the next tag in that list
  • :tp or :tprev goes to the previous tag in that list
  • :tf or :tfirst goes to the first tag of the list
  • :tl or :tlast goes to the last tag of the list