The configuration of the Centos vim in Xshell

Source: Internet
Author: User

The VI in CentOS only installs the vim-minimal-7.x by default. So whether the input VI or VIM to view the file, the syntax function is not enabled properly. It is therefore necessary to install the other two components with Yum: vim-common-7.x and vim-enhanced-7.x.

On the command line: yum-y install vim-enhanced, Yum automatically installs the two components. You can then add syntax on to the. VIMRC in the current user directory to take effect.

Other configurations add by themselves, and below I just add what I need:

  Number of rows displayed: Set Nu

Tab interval: Set tabstop=4

Row interval: Set shiftwidth=4

  Sets the matching pattern, similar to the corresponding closing parenthesis when an opening parenthesis is entered: Set Showmatch

In the edit process, the status line at the cursor position is displayed in the lower-right corner: set ruler

Query is very convenient, such as to find the book word, when input to/b, will automatically find the first B word, when entered into the/bo, will automatically find the first Bo beginning word, and so on, to find, use this setting will quickly find the answer, when you find the word to match, do not forget to enter: Set Incsearch

Get rid of nasty about VI consistency mode, avoid some bugs and limitations of previous versions: set nocompatible

Detection file type: filetype on

Number of rows recorded history: Set history=1000

Turn on automatic backup:

If has ("VMS")
Set Nobackup Keep a backup file, use versions instead
Else
Set backup "Keep a backup file
endif

The remaining configuration can be viewed in the table of contents:/etc/usr/share/vim/vim74 (different version number, different name)/vimrc_example.vim, modify it, add it, or copy it directly.

Thank you for reading, if you have a good configuration, please add the Garden friends.

The configuration of the Centos vim in Xshell

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.