Use vim (3):. viminfo and. vimrc, vim. viminfo
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
In Linux, the direction keys vi and vim are changed to ABCD. You can change the name to vimrc in the user directory copied by vimrc_examplevim on the Internet.
Hello, first, vimrc is used to set the default status after vim is started.
For example, Edit. vimrc under/root to add set nu
By default, vim indicates the row number of each row when editing the file, and so on.
If you switch to an abc user, you need to add/root/. vimrc to the root directory of the corresponding abc user in the default set nu function.
In vim, map in vimrc is mainly used by leader.
<Leader> is a prefix. when you enter a command, add this prefix and then the command following <leader>. In your example, It is ee.
This <leader> can be configured. In the script, let mapleader = ','. Next time you enter it, ee will execute your SwitchToBuf function. Mapleader is usually configured with commas (,), backslash (\), and so on.
Example:
Let mapleader = ','
Let mapleader = '\'