Ctags Create a Vim form index file with the Include header file

Source: Internet
Author: User
Ctags CV include header file index

At some point, in order to easily see the definition of the related structure or data type in the header file, we want to delve into the head file, where Vim is not as visible as the various IDE tools under Windows, but there are powerful tools, such as Ctags.

Ctags principle is in the header file directory, according to the library file naming habits, automatically find related library header files, and resume index.
For Linux, most libraries are placed in the/usr/include/folder, and most of the header file references are here when we write the code. using Tools Ctags

Establish steps
1. Download and install Ctags Tools, installed on the need, installation method, I use ubuntu16.04, convenient use of Apt-get install ctags to get it done;
2. Because the header files are all under/usr/includes/, the operations are performed in this directory:

$SU Root
#cd/usr/includes/

3. Then use the tools.

#ctags-R lib*
Note that this folder should have root permissions;

Then a tags file is generated under the folder
4. Use Vim to open to see the index file:

#vim tags

5. Enter in the bottom row mode of the index file

: TS pthread_attr_t

Then, you can see the relevant information, according to the prompts to enter the corresponding number + return, you can find the definition of the type declaration;
6. If you find a definition that has a heavy and unclear data type, you can move the cursor over the data type name and press the key combination:

CTRL +]

You can dive in and see the definition of the unclear data type, so that you can go deep into the layers.

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.