1. install Ctags under Ubuntu first download the source code to the http://ctags.sourceforge.net, unzip $. /configure $ make $ sudomakeinstallorsudoapt-getinstallctags2. run $ ctags-R "-R" in the source code directory to recursively create the source code, which includes the source code in all subdirectories under the source code root directory.
1. Install Ctags in Ubuntu
First download the source code to the http://ctags.sourceforge.net, unzip
$./Configure
$ Make
$ Sudo make install
Or
Sudo apt-get install ctags
2. Run the command in the source code directory.
$ Ctags-R
"-R" indicates recursive creation, that is, the source code under all subdirectories under the source code root directory. The tags index file is generated under the current directory.
Assume that the current source code directory contains the following content:
./Makefile
./Src # folder for storing source code
After ctags-R is executed
./Makefile
./Src # folder for storing source code
./Tags
The "tags" file contains a list of these objects:
Macro defined by # define
Enumerated variable value
Function Definition, prototype, and Declaration
Namespace)
Type Definition (typedefs)
Variables (including definitions and declarations)
Class, struct, enum, and union)
Class, structure, and union member variables or functions
3. vim will use the index in the tags file to locate
Run vim in the directory where the tags file is located to open the source file. c or. h.
A. move the cursor to the position of the variable or function to be viewed. Press ctrl +] to jump to the position defined by the variable or function, and press ctrl + o to return.
B. Stop the cursor at the place referenced by the header file. Press the gf key to jump to the header file. ctrl + o returns
C. Place the cursor in the position of a function or variable. gd will highlight all functions or variables in the current file and press n to view the next one.
D. gg The cursor returns to the top of the file
Install Ctags http://www.linuxidc.com/Linux/2014-03/97620.htm in Ubuntu
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2014-04/101144.htm