Vim View function prototypes
Vim View function prototype can be divided into system functions and custom functions
First, the system function:
I use Shift+k
Second, the custom function: Vim with ctags realization function prototype fast localization
Ctags can parse the program to generate the tag file for Vim, so that in writing programs to achieve function prototype, data structure declaration, such as fast jump, it is convenient.
First make sure that you have Ctags installed in your Linux system. If not, please install Ctags first. If it is a Debian or Ubuntu system, run directly on the terminal:
sudo apt-get install Ctags
After loading the ctags, find a source directory, run the following command on the terminal, will generate a tags file.
Ctags-r
Then open VI, enter a directive similar to the following, tags= the full path name of the tags file just generated.
: Set Tags=/your/path/to/tags
Then you can try to jump. If it is a frequently used project, write the above set line in your. vimrc file.
Common Jump Method: The cursor Ctrl] Key: Jump to the cursor where the word tag. Ctrl-t key: Jumps back to its original position. G] key (press G and then press]): If you have multiple tags with the same name, you can jump with these two keys, you will be prompted to select the serial number.
Three, display the function list:
Approximate usage: When using VIM, use: The Tlisttoggle command toggles the function list on and off. Hold down the CTRL key and then double-click the W key to toggle between the normal edit area and the tags area. In the tags area, move the cursor to the variable, function name, and then hit enter, it will automatically in the normal editing area to locate the specified content, very convenient. If we write a function that should first save the file and then switch to the Function list area and then switch back from the list area, we can see that the list area has the function we just wrote.
- This article is from: Linux Learning Network
Vim View function prototypes