Vim Find replacement
: n1,n2s/word1/word2/g N1,n2 is a number, find N1 to N2 line, word1 Replace with Word2
: 1, $s/word1/word2/g find the first line to the last row, word1 replace Word2
: 1, $s/word1/word2/gc find the first line to the last row, word1 replace Word2 before replacing the confirmation.
Configuration of the VIM environment
Set NU Display line number
Set Nonu suppress line number display
Set backspace=2 can be deleted with backspace key
Set Autoindent auto-shrink
Syntax on syntax detection, color display
Locale settings
Lang=zh_cn.big5 setting Traditional Chinese
Vim Quick Note #
Switch to Visual block CTRL + V Select the row to comment
Uppercase I toggle insert mode. # input #
ESC can
Using the Replace command
:% s/^/#/g To add a # comment at the beginning of the entire content
: 1,10 s/^/#/g Add # Comment at the beginning of 1~10
Multi-Window function
: SP {filename} can open multiple windows
CTRL + W + Lower
CTRL + W + Toggle windows on
The simple and practical vim