Configuration of Vim

Source: Internet
Author: User
Tags set background

Just installed Vim, perhaps the interface is not very friendly, which requires us to change the vim configuration file, according to our needs to modify it.

Under command line, enter the command:sudo vim/etc/vim/vimrc

You must add sudo, otherwise you are not authorized to edit VIMRC.

The following is a small series of vim configuration information:

1 "All system-wide defaults is set in $VIMRUNTIME/debian.vim and sourced by2 "The call To:runtime you can find below. If you wish to change any of those3 "settings, you should does it in this file (/ETC/VIM/VIMRC), since Debian.vim4 "Would be overwritten everytime a upgrade of the VIM packages is performed.5 "It's recommended to make changes after sourcing debian.vim since it alters6 "The value of the ' compatible ' option.7  8 "This line should is removed as it ensures that various options is9 "Properly set to work with the vim-related packages available in Debian.Tenruntime!Debian.vim One "#set ts = 4" A "#set SW = 4" - "Uncomment the next line to make Vim more vi-compatible - "NOTE:debian.vim sets ' nocompatible '. Setting ' compatible ' changes numerous the "options, so any other options should is set after setting ' compatible '. - "Set compatible -   - "VIM5 and later versions support syntax highlighting. Uncommenting the next + "Line enables syntax highlighting by default. - ifHas ("Syntax") + Syntax on A endif at  - "If using a dark background within the editing area and syntax highlighting - "turn on this option as well - "Set Background=dark -   - "uncomment the following to has Vim jump to the last position when in "reopening a file - "If has ("Autocmd") to "au bufreadpost * if line ("'\ "") > 1 && line ("'\"") <= Line ("$") | Exe"normal! g ' \ ""|endif + "endif -  the "uncomment the following to has Vim load indentation rules and plugins * "according to the detected filetype. $ "If has ("Autocmd")Panax Notoginseng "filetype plugin indent on - "endif the   + "The following is commented out as they cause vim -to-behave a lot A "differently from regular Vi. They is highly recommended though. the "Set ShowCmd"Show (partial) commandinchstatus line. + "Set Showmatch"Show matching brackets. - "Set ignorecase"Do CaseInsensitive matching $ "Set Smartcase"Do Smart CaseMatching $ "Set Incsearch"Incremental Search - "Set Autowrite"Automatically save before commands Like:next and: Make - "Set Hidden"Hide buffers When they is abandoned the "Set Mouse=a"Enable Mouse usage (all modes) -  Wuyi "Source A global configuration file if available the ifFilereadable ("/etc/vim/vimrc.local") -source/etc/vim/vimrc.local Wu endif - Set Nu AboutSet tabstop=4 $ Set Nobackup - Set Cursorline - Set Ruler -Set Autoindent

1. In this document, there will be a sentence:

Syntax on

It means syntax highlighting, and if you're commented out, please "let it out."

2. Enter them in the last line of your vim to make your vim more beautiful and comfortable.

Set Nu//on the left line number

Set TabStop//tab length to 4

Set nobackup//Overwrite files without backup

Set Cursorline//Highlight when forward

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

Set autoindent//Auto Indent

After saving, the configuration is complete.

The above configuration, in fact, is very simple, such as some color scheme, and so on, small and not written, if you have other needs, suggest Baidu.

Configuration of Vim

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.