The CTAG plug-in is mainly used to jump between variables and function definitions like in VC, so it is very convenient.
Download and install: http://down1.chinaunix.net/distfiles/ctags-5.2.3.tar.gz
Tar-xzvf ctags. xxxxxx
./Configure -- prefix = installed directory
Make; make install
Ctags-version test whether the installation is successful
Usage:
Ctags-R
"-R" indicates recursive creation, which includes the source program under all subdirectories under the source code root directory. The "tags" file contains a list of these objects:
L macro defined by # define
L enumerated variable value
L function definition, prototype, and Declaration
L namespace)
L type definition (typedefs)
L variables (including definitions and declarations)
Class, struct, Enum, and Union)
L class, structure, and union member variables or functions
Vim uses this "tags" file to locate the marked objects above. The following describes how to locate these objects:
1) Use the command line. Add the "-T" parameter when running vim, for example:
[/Home/Brimmer/src] $ vim-T foo_BAR
This command will open the file defining "foo_BAR" (variable or function or other), and position the cursor to this line.
2) use the ": Ta" command in the vim Editor, for example:
: Ta foo_BAR
3) the most convenient way is to move the cursor over the variable or function name, and then press "Ctrl-]". Return the original location with "Ctrl-o.
Note:When running vim, you must run it in the directory where the "tags" file is located. Otherwise, run the ": Set tags =" command to set the path of the "tags" file so that Vim can find the "tags" file.