Ctags application in Vim

Source: Internet
Author: User

Ctags (Generate tag files for source code) is a handy code reading tool under Vim. Although Ctags can also support other editors, it officially supports only vim. And Ctags is already installed by default in Vim, which can help programmers navigate through the source code with ease.

Ctags can locate the following:
1) macros defined with # define
2) The value of the enumeration type variable
3) definition, prototypes, and declarations of functions
4) Namespaces (namespace)
5) type definition (typedefs)
6) variables (including definitions and declarations)
7) class, struct (struct), enum type (enum), and Union (union)
8) member variables or functions in classes, structs, and unions

1. First install the Ctags tool:

sudo apt-get install Ctags

2. Configure the Ctags tool:

Cd/usr/include

sudo ctags-r./

VIM/HOME/LINUX/.VIMRC the last side of the script file, add the following set Tags=/usr/include/tags

Ctags-r//means that under a folder ctags all the symbolic information under the current folder is collected, into the SU root user, and then you can use

Vim-t alloc_chrdev_region//can find alloc_chrdev_region this symbol information.

3. Application

Enter define out with CTRL +]

Return to the original place: Ctrl + T

Ctags application in Vim

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.