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

3 comments:

  1. nice information. can u describe more about ctags

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. With this blog student gain lots of practical knowledge. If any student looking for Linux Kernel education in India. Visit India Higher Education Portal My Next Exam and also visit Computer Science Colleges in India for getting course and colleges information

    ReplyDelete