Use Vim (III):. viminfo and. vimrc

Source: Internet
Author: User
Tags eol

1. viminfo
Vim automatically records the operations performed in vim and stores them in ~ /. Viminfo file. In this way, the cursor is automatically displayed at the last exit when Vim opens the file. The previously searched string is automatically highlighted when a new file is opened.
~ /. The viminfo file is automatically generated by the system.
2. vimrc
The vimrc file is the vim environment setting file. The overall Vim settings are in the/etc/vimrc file. It is not recommended to modify the/etc/vimrc file. Each user can set Vim in the user root directory to create ~ /. Vimrc. Vim has many configuration options,
 
: Set all
You can view all configuration items.
Common configurations:
: Set nu: Set Nonu whether to display row number: Set wrap: Set nowrap whether to wrap: Set hlsearch: Set nohlsearch whether to highlight: Set autoindent: Set noautoindent whether to automatically shrink: whether set backup automatically backs up and modifies files. The default value is no. If set bakcup is used, filename ~ is automatically generated during the modification ~ Backup file. : Set rmode display lower-right status bar: Set showmode display lower-left status bar, -- insert -- and the like: Set display different values from the system default value,: syntax on: syntax off program syntax switch: set BG = Dark: Set BG = light display color tones

3. My vimrc
 
Set number "display row number set nowrap" Do not wrap set shiftwidth = 4 "Default indent four spaces set softtabstop = 4" When tab is used, the number of tab spaces set tabstop = 4 "tab represents four space set laststatus = 2 "always displays status rows # backspace key" indent delete auto indent value "EOL Delete the carriage return at the end of the previous row, merge the two rows. In addition to the ones just entered, start also deletes the original character set backspace = indent, EOL, startset expandtab "replace tabset autoindent with spaces" auto indent colorscheme evening "color mode SYN on" syntax highlight filetype on "file type set encoding = UTF-8" encoded as utf8

Address: http://blog.csdn.net/yonggang7/article/details/38457633

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.