Vim Common Configuration

Source: Internet
Author: User
Tags function definition

As a program ape under Linux, if you don't know how to use vim, it's not really a program ape (if not in a graphical interface). But Vim is the kind of steep learning curve tool, only you really long time to learn the command of vim you can really understand, let Vim called God's editor.

This article is mainly to summarize their own in the use of vim in the process of some of the basic methods, as a reference to their own, and to let other people need to get help.

 "normal Configurationsset nu " Show line number  set  Tabstop=4  shifwidth=4  set  expandtabset  autoindentfiletype Plugin Indent on   syntax on   set  hlsearch Span class= "hljs-string" > "highlight Search"  set  backup Extension and  directoryset  Backupext=.bak set  backupdir=~/backupiabbrev @@ [email protected]  "quick Insert Eamil info   

Above just to do some basic settings, followed by a few more practical plugins, these plug-ins to make vim really powerful up.

Supertab

Supertab is an automatic completion of the VIM plug-in, in fact, without this plugin we use C-n, c-p can also be auto-complete, but this plug-in improved efficiency. But the plugin has a drawback, that is, when we really need to enter the tab, but not, unless we are in front of a space or a line in the actual location. Here's a way: c-v, tab, C-v tells Vim that the next input is directly as input and does not require any parsing.

Air-line

This plugin is similar to Vim-powerline, but the author says the plugin is more lightweight and does not depend on others. The function of this plugin is to enrich the function of Vim's status bar. It can display the name of the file, display the function name, there are some warning messages and so on. Specific content you can find on GitHub.

Indent-line

When programs become large, they tend to be misaligned, especially for Python, which is a very strict requirement for alignment. Indent line is to make alignment visualizations. The developer of the plugin exploited the new features of Vim (vim7.3 version and above). For some common needs, we can do this with the following commands:

setlist

So that we tab to the \^i, we can set the tab to the symbol we want with more granular settings:

set listchars=tab:>,trail:-

The tab is displayed as >-, and the trailing extra white space character is displayed-

Tagbar

The Tagbar and TagList functions are similar, but more powerful. It can generalize function declarations, classes, macro definitions, etc. in program files and display them as sidebar. We can use c-w, right, to select this window, and then quickly switch between function declarations. Here are some small shortcuts:

    • GD Local lookup variable
    • [[ ]] moves within the function definition body
    • GF Opens the corresponding file name in the Include location
Ctags

The high version of Vim comes with ctags, we only need to use the following command in the corresponding directory:

-R./

Then use the following method in the. VIMRC configuration file:

set tags=./tags;

Note that the semicolon is followed by a space, this is to let vim in the current directory can not find the Ctags file, the upward recursive lookup.

End of this article

Vim Common Configuration

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.