Use vim (III):. viminfo and. vimrc
1. viminfo's operations in vim will be automatically recorded by vim and saved 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. The vimrcvimrc 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