The use of Vim+ctags+cscope

Source: Internet
Author: User
Vim+ctags+cscope

Note: First read this article before the best is already familiar with the Linux operation, because I did not step-by-step to tell you how to configure, and some specific usage is not detailed, just share some configuration experience
This is the VIM interface I've configured.

I believe you are the first to contact VIM (or Linux?) After opening a file, for example:
Vim test.c
Out of the interface and operating methods, accustomed to windows that gorgeous IDE (or editor) may be a little uncomfortable.
But when we are properly configured and accustomed to the "editor God" command, we thank the person who brought you into the Linux world. VIM Configuration

Let me first say the configuration of the window where I edit the code, and the other windows will be later .
Vim needs enough configuration to change it to achieve its own effect, such as sometimes vim Chinese garbled will add 678 lines, and the rest of the automatic indentation and so on, this file is the home directory of the. vimrc files (not created by yourself), other configurations can also be added by themselves:

The following configuration file is "/usr/share/vim/vim74/syntax/" (the default installation directory) under the C.vim file, of course, if you can also change Java.vim, but Java development seems not how to use VIM. Can change the keyword color, underline and so on according to own preference, I only add the following lines, feel enough.

File and Tag Management window Winmanager
Code editing window configuration is almost, there are two windows on the left: the above is your source files of some variables, function name, such as Tag_list, and the current directory of the file list is file_list. This can achieve the same effect as Windows IDE, easy to jump (by the way, switching windows with CTRL-WW).
Then how to use this thing how to wear it.
You can install such a software:
sudo apt-get install Vim-add-manager
This thing is used to manage the Vim plugin. Like mine.

You can vim-addons whichever you want to install (including some key words and so on) Ctags+cscope

Let's talk about Ctags and Cscope. First install

sudo apt-get install Cscope
Ctags is the top of the taglist (if not that I forgot, can find the source)

And then in the source directory that you need to edit,
Ctag-r
Cscope-rb
Used to generate data retrieval library files tags, cscope.out.

Then if you use my profile, you can use it directly (if you don't need to be in trouble, also want to add the above two files, specific can check cscope usage, these two plug-ins can achieve a variety of jumps, such as according to my configuration when the cursor on a function click on "ctrl+\" + "G "You can jump to its definition. (For ctags you can use CTRL +]).

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.