Talking about VIM environment setting

Source: Internet
Author: User

Sometimes the default Vim environment is not suitable for your requirements, and we can adapt to our needs by modifying Vim settings such as fonts, colors, auto-indentation, and so on.

The usual setup parameters are as follows:

: Set Nu

: Set Nonu sets and cancels line numbers

: Set Hlsearch

: Set Nohlsearch to find whether the string is anti-white display

: Set all to display all environment parameter setting values

: Set displays settings parameters that differ from system default values

: Set autoindent Auto Indent

: Syntax on

: syntax off whether to display different colors according to different program-related syntax

: Set Bg=dark

: Set Bg=light sets a different tone

In addition,: Highlight can display, set specific color rules

These settings can be set directly in the file opened with Vim, immediately, but after exiting the settings will not have, if we want to make these settings permanent, then we need to use the following to modify the Vim configuration file.

The system has configuration file/ETC/VIMRC on the VIM environment settings, but it is best not to modify the system configuration file, because it will sound to all users of the VIM environment. We can set our own VIM environment in the ~/.VIMRC of our own home directory, the file does not exist, need to create vim ~/.VIMRC

If I want to make the VIM environment default to display line numbers automatically indent, yan * * * dark, then my ~/.VIMRC can be set

Set Nu

Set Autoindent

Set Bg=dark

Save the exit and then use the command source ~/.VIMRC to have the configuration take effect immediately, when we re-use VIM to edit the file, we will find that the VIM environment has been modified


This article is from the "Luohaizi" blog, make sure to keep this source http://597881426.blog.51cto.com/6819945/1686768

Talking about VIM environment setting

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.