I have summarized 18 very useful vim commands. The most famous program editor in Linux is not vim. In normal mode, 1. dd -- delete the row where the cursor is located 2./word -- specify the word for full-text search 3.G -- move the cursor to the last row of the file and move it to 99th, delete one character in 99G4 and lowercase x, and delete one character in uppercase X 6,: 1, $ s/word1/word2/gc -- search for word1 from the first row to the last row, replace it with word2 and ask if to replace 7,: 1, $ s/word1/word2/g before replacement -- search for word1 from the first row to the last row, replace it with word2, do not ask 8, u -- undo the previous operation 9, CTRL + r -- repeat the previous operation 10, yy -- copy the row where the cursor is located, copy the next six rows of the cursor, is 6yy11, p -- delete the post to the next line of the cursor, paste in uppercase P to the top line of the cursor 12 in Normal Mode press, a/A/I/I/o/O/r/R enter edit mode in command mode 1. ZZ -- Note: There is no colon. If the file is not modified, exit directly; if the file is modified, save it and Exit 2. set nu -- set row number 3 and: s. Et nonu -- Cancel row number 4,: w filename save the file as filename5, And: r filename write the filename file in the last line of the file, which is equivalent to copying the content of filename to the end of the file 6 ,: wq! -- If the file is read-only, force save and exit