Talk Vim together (17th back: csscope of Vim plug-in), vimcscope

Source: Internet
Author: User

Talk Vim together (17th back: csscope of Vim plug-in), vimcscope


Hello, everyone. You are welcome to join in to hear the story of Zhang huiti: Vim. We introduced the ctags in the Vim plug-in last time.

In this case, let's continue with the Vim plug-in. In this case, we want to talk about the Vim plug-in: cscope. Okay, let's just say that,

The words are right. Let's talk Vim together!


Look, this time we are talking about the plug-in Vim: cs.pdf. Cssag is a tool, or an application software. It works with ctags.

Similar, but it is more powerful than ctags, but it is not an upgraded version of ctags, because it has some features not available in ctags.

It can also run in Vim as a plug-in, which is the same as ctags. Csflood can put the file name and function in the source code

Names and variable names are collected together and a database is generated. We can import the database to Vim to conveniently find files,

The call relationships between functions, variables, and even functions can be found. The database files generated by CSWs can also be compared to maps. No

Compared with the map generated by ctags, this map is more accurate because it can locate things that cannot be located by ctags,

For example, file name and variable name.


We do not have cssag installed by default in the Mint, so we need to install it manually. The installation method is as follows:

  • 1. Check cscope:

Run the command: which csich to check whether cscope is installed in the system.

.


  • 2. Install cssag:

Run the command apt-get install cscope to install cscope.

Account to execute the command). The following result is displayed:

Reading the package list... complete

Analyzing the dependency tree of the software package

Reading status information... complete

Recommended software packages:

Cscope-el

The following [new] software packages will be installed:

Cscope

0 software packages are upgraded, 1 new software package is installed, 0 software packages are to be uninstalled, and 388 software packages are not upgraded.

Download the 143 kB software package.

After decompression, 756 kB of extra space will be consumed.

Get: 1 http://archive.ubuntu.com/ubuntu/ trusty/universe cscope i386 15.8a-2 [143 kB]

Download 143 kB, which takes 2 seconds (70.9 kB/s)

Selecting previusly unselected package cs.pdf.

(Reading the database... the system currently has 158092 files and directories installed .)

Preparing to unpack.../cscope_15.8a-2_i386.deb...

Unpacking cscope (15.8a-2 )...

Processing triggers for man-db (2.6.7.1-1ubuntu1 )...

Setting cssag (15.8a-2 )...


  • 3. Confirm cscope:

Finally, check whether the installation is successful. The method is the same as in step 1: which cs.pdf,

Run the following command:/usr/bin/cscope. This indicates that cssag has been successfully installed in the system.


As we said in the previous article, when using Vim + ctags to read the source code of the program, you can quickly locate the function definition,

It saves time for searching functions and improves the efficiency of reading program source code. If you want to add cscope to the Vim plug-in

It is Vim + ctags + cs.pdf. The Vim function is further extended. It not only allows you to quickly locate functions, but also

To quickly locate files and variables, and even the call relationship of functions, you can also locate them. Look, do they all feel itchy,

Try it on your own. As Grandpa Mao said, "Do it yourself and enjoy plenty of clothes.


For more information, see the Vim plug-in cssag. In later chapters, we will also talk about other Vim plug-ins.

. What plug-ins will be available in the future? In addition, the next loop is decomposed.

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.