I. From command to zookeeper Mode
A: append is inserted after the current word.
I: insert Insert at the current position
O: insert open new line in a new row under the current row
A: append is inserted at the end of the current row.
I: insert at the beginning of the current row
O: insert open new line in the new row.
I, A, o, I, A, O, and I are more often used than workers. I am familiar with it in the future.
II. From zookeeper to command
ESC:
CTRL + [: it can achieve the same effect. Students with short fingers can use it instead of ESC.
3. Other commands in command mode
In the command mode, there is a lot of attention. These introductions are basically used to participate in high-speed programming, and need to be familiar with them.
In VI command mode, some are still in command mode after being pressed by volume, and some are modified by character or copy/paste.
Return to the command mode, and some do not change back to the text encoding mode.
Some operators will make special positioning for the content you originally wanted to change. For example, if you want to change a word, it will also take you to the simplified command mode.
File
: Q: Activate VI quit
: E xxxx Edit
: W memory write
: W xxxx another deposit case xxxx
: Q! Don't save or unfreeze
: W! (Read-only files cannot be written without an exclamation point)
: WQ memory and shard write 'n' quit
: BD closes the current window
Mobile Games
H, J, K, L to the left, down, up, to the right are not abbreviations of English words, but to allow your fingers to control the movement of the cursor more quickly
0 to the beginning of the line
$ To the end of a row
^ The first non-blank word in this line
W, w to next word, to next non-blank Word forword
B and B go back to the previous non-blank word Backword
E, E to the end of the word, to the end of the next non-blank word
CTRL-F, Ctrl-B to the next sector, one forward sector
G to the end of the file
: N to the nth line (so to the file header is: 1)
CTRL-g limit indicates that the current row is in the nth line.
J. Add the following row to the current row join
Search and replace
/
/Pattern: Find pattern in the lower part. Note that several special characters must be prefixed \. These characters are:. * [] ^ % /\?~ $
? Run the pattern command to search for the pattern.
N, continue to seek
N and then go to the terminal to find
: S/patrn/str/CGI search replace STR patrn
The parameter range (range) must be specified between the parameter and the value of S.
1, 10 indicates 1-10 rows
% Indicates the entire object
Last CGI
C Indicates confirm timeout
G indicates global all
I indicates ignore, regardless of size
Common metacharacters
CC change to change
Dd cut the entire line delet
YY copy the entire Yank line
P, P paste (paste) The put you recently cut or copied
Change CW to a word
D $ cut to the end of a row and delete $
Ye copied the letter to the end of Yank E.
R and R replace one character and replace the entire line of replace
U, u undo the last modification, undo the whole row
X and X cut down a character and cut back a character (based on backspace)
Handling of duplicates
. Refresh the zookeeper command or refresh
Many of the preceding commands can be combined by yourself,
There is a general rule that a single command is repeated twice for the whole line, followed by W for a word, and a number in the center is the number of repetitions.
For example, c5w can change five words and d3d can delete three rows.
For more information, see
Ce, 3x, 5dd, 10 W, D0, y $, 5g
Indentation
> One indent to the right
<One indent to the left
= Automatically indent the current row
= G automatically indent the current row and all subsequent rows
Gg = g first move to the beginning of the file, then... Hey, full text indent
C-w j k h l move down upper left right window