Tip 7: etags

From Vlsiwiki
Revision as of 17:47, 2 April 2010 by Mrg (Talk | contribs) (Created page with 'For use with C++: etags --c++ *.cpp *.h or add it to your Makefile to automatically update. This will create a TAGS file in your current directory that contains includes loc…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

For use with C++:

  etags --c++ *.cpp *.h

or add it to your Makefile to automatically update. This will create a TAGS file in your current directory that contains includes locations and defnitions of functions in your program for fast look-up.

In emacs, to load a tag file use:

esc-x
visit-tags-table

Once you have the tags table loaded you can:

esc-.  	

Find a definition for a tag. The default tag is identifier under the cursor. Name completion type partial name and then TAB.

ctrl-x 4 . TAG 	

Display tag in new window.

esc-, 	

Find the next definition for the tag.

esc-* 	

Pop tag stack (go back one level)


In vi, you can load a function directly from the command line:

vi -t   subroutine_name

or within vi:

:tag subroutine_name

or by placing your cursor over the function and typing:

ctrl-]


More information is here:

http://en.wikipedia.org/wiki/Ctags