Today I learned the VI command-general Linux technology-Linux programming and kernel information. The following is a detailed description. From the first time I touched Linux in to now, I will only use I,: w,: wq,: q! --. I have always wanted to learn, but I have never done it. It seems that I have always had this bad habit. If you want to do this, you don't need to do it.
Recall the vi command, mainly from the perspective of laruence. Memories, for fear of forgetting.
General mode:
Move cursor
Hjkl left bottom top right
0 to the beginning of the line
$ To the end of a row
H indicates the uplink of the current screen.
M in progress
L lower
NG to n
G to the end of the article
Search
/Word Backward Search
? Word forward search
: 1, $ s/word1/word2/gc replace word1 with word2, which needs to be confirmed
: N1, n2s/word1/word2/g replace n1, and word1 between n2 is word2
Enter edit mode
I insert
A add
R replace, R continuous replacement
O add a row
General commands
Delete characters from x and X
Dd deletes a row.
Yy copy
Ndd
Nyy
DnG deletes the content from the cursor to line N.
YnG copies the content from the cursor to line N.
P Paste
J. Merge the next row
U undo
Command
:! <Command> Run this command in shell.
: R filename: add the content of filename to the cursor
: W save
: Q exit
: E! Restore to initial state
: Set nu display row number
: Set nonu does not display row numbers
ZZ is saved and exited if it is modified. Exit directly if it is not modified.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service