Vim View function prototypes

Source: Internet
Author: User
Tags function prototype

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.