[To] http://rainbird.blog.51cto.com/211214/109308
The VI function is so powerful that it only lists what I often use and is gradually added.
: Redo in Linux, cancel the Undo operation to restore text modification. In standard UNIX systems, 2nd U commands cancel 1st U commands, and the result is a "redo"
12 | move the cursor to the 12th column of the current row
CW only modifies the word at the cursor (delete the word and enter append mode to add text at the position of the word to be deleted)
S (lower case) replace a single character
S (uppercase) replaces the entire line of text
CC replaces the entire line of text (same as S)
: 12th, 35 move 58 command will be ~ All the text between 35 rows is moved to the end of 58th rows. Abbreviated as Mo
: 1st-Co 82 ~ Copy all text between the 26 rows to the end of the 82nd rows (you can select a row number)
: 7th s/March/walk/will search ~ All text lines between 37 rows, and replace the 1st target strings march in each line with the string walk. Modify 1st target strings on all specified rows
,: 1st W newtext command to create a file named newtext, and ~ Copy six lines of text to the newtext file.
: 1st W> oldfile: replace ~ Append a copy of the six lines of text to the end of the existing file oldfile.
! Oldfile uses 1st ~ of the current file ~ Six lines of text overwrite the oldfile: 1st W newtext command to create a file named newtext, and ~ Copy six lines of text to the newtext file.
: 1st w> oldfile: replace ~ Append a copy of the six lines of text to the end of the existing file oldfile.
! Oldfile uses 1st ~ of the current file ~ Six lines of text overwrite the oldfile
:! Ls starts a shell and enables the shell to run the ls program. After running the specified program, you must press the Enter key to return to the editor.
:! Ksh starts a shell, which allows you to run multiple commands. Exit shell and return to the compiler.
: Or! Speel % checks the spelling of the current file (%), and sends the spell output to the current file, starting from row 1st (after line 0 ).
: 31r! Command % run a UNIX command (such as cal or date) and read its output to the current file. Place the output from line 1
This article is from the "rainbird" blog, please be sure to keep this source http://rainbird.blog.51cto.com/211214/109308