Ready to start learning Vim editor, first to vim some of their own configuration, because a lot of things do not know very well, first simple configuration, and then slowly updated later.
The configuration file for Vim is a. vimrc file, which is a hidden file and is created under the $home directory to use the configured functionality under the current user.
The currently configured features are
1 Syntax on2 3Set tabstop=44Set softtabstop=45Set shiftwidth=46 7 Set Autoindent8 9 filetype Indent plugin onTen One Set Ruler A - Set Showmatch - theSet backspace=2
Syntax on means syntax highlighting
Set TabStop
Define the length of the space that the tab is equal to, generally preferably set to 8, because if it is a different value, it may cause the file to look awkward in the case of printing. Unless you set the expandtab
pattern, that is, to convert the tabs to a space, so that will not be confused, but after all, Tab 8 is the most commonly used most common settings, so generally do not change.
Set Softtabstop
What if we want to change the indentation in the program? shiftwidth
and tabstop
not the same, you will find that the program is rather ugly. At softtabstop
this time, it worked. You can see from the description of vim, once softtabstop
you set the value, you press the TAB key, insert the Space and Tab tab of the mix, how to mix depending on what you set softtabstop
, for example, if set softtabstop=8, then press the TAB key, Insert is a normal tab, if set softtabstop=16, then insert is two tab, if softtabstop=12, then inserted is a tab and 4 spaces, if softtabstop
= 4? At first, the insertion is 4 spaces, and once you press the tab again, this time the four spaces will be combined with the last four spaces into a tab. In other words, softtabstop
it is "every 8 spaces into 1 tabs", if you tabstop=8
.
Set Shiftwidth
This is indicated by the blank length used for automatic indentation in the program. In general, in order to maintain the beauty of the program, and the following parameters are best consistent. It is also the creator of the symbol shift length.
Set Autoident
Set up auto-completion
FileType Indent plugin on
Set file type automatic recognition
Set ruler
Opens the bottom right corner of the cursor position display
Set Showmatch
Highlight matching parentheses
Set backspace=2
Setting BACKSPACE keys
VIM Configuration Summary