Cainiao configures vim and cainiao vim

Source: Internet
Author: User

Cainiao configures vim and cainiao vim

I don't know how cainiao configures vim.

If you want to make your vim and VS similar, you must use this URL.

Http://www.open-open.com/lib/view/open1429884437588.html

After Linux is started, it is inevitable to use the vim editor. At the beginning, vim may be unfriendly (not necessarily friendly)

Then I learned how to make it friendly. What does it mean? That is to say, I compile C ++, but I usually compile code in VS2015. After I write C ++ code in Linux, I am very upset with the installed vim, because the line feed is not indented, You need to press the Tab on your own, and there is no completion. The function name cannot be remembered and is really speechless.

Then I searched for it and saw the knowledge about vim configuration. I did not understand it at all, and I was totally new to it. So if the writing is not good, point it out. I want to change it ~

So the first thing is coming,See how cainiao understands vim configurations.

I usedCentos7Therefore, it is quite different from centos6. Most of the textbooks are about centos6, so it is quite difficult for me to learn it.

  • First, find the vim configuration file.,In centos 7In this directory./Etc/vimrcDirectCd/etcAnd then you will see it (and the vi configuration file is also there ).

  • Open it !! Vim vimrc (the premise is already in this directory). Remember the permission problem. It is best to enter the root user. Otherwise, the permission cannot be modified, and you will see

Then configure him! How to configure it? Modify the configuration file,Move the cursor to the end of the file and add the configuration statement to save the modification.Here I will post some configuration statements

 

Set nu // The row number on the left

Set tabstop // set the tab length to 4

Set nobackup // do not back up when overwriting files

Set cursorline // highlight the current row

Set ruler // display the status line at the cursor position in the lower right corner

Set autoindent // auto indent

Set tabstop = 4

Set softtabstop = 4 // set the (soft) tab width to 4:

Set shiftwidth = 4 // set the number of indented spaces to 4

Set autoindent // set Automatic indent: that is, the indent value of each line is equal to that of the previous line; Use noautoindent to cancel the settings:

Set cindent // use the C/C ++ auto indent Method
Set cinoptions = {s, t0, N-2, p2s, (03 s, =. 5 s,> 1 s, = 1 s,: 1 s // you can specify the indentation mode for C/C ++;
Set nu // display the text line number
Chinese display problems,
You can add:
Let & termencoding = & encoding
Set fileencodings = UTF-8, gbk, ucs-bom, cp936
Expand the character encoding. Generally, Chinese files in windows will not be garbled in Linux.

In simple terms, it is so much. We do not recommend you add some statements. If there are few changes, you can try it yourself. I recommend you find a configuration file written by someone else, how can we be lazy? The key is that there are many better functions available to others ~

 

Http://www.cnblogs.com/ma6174/archive/2011/12/10/2283393.html

It is strongly recommended !!!!!I will use this really good thing. Isn't it convenient to use this configuration ~

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.