Linux: Vim basic commands

1. A new terminal: the Ctrl + + n-the Shift ;
2. New terminal tags: the Ctrl + T + the Shift ;
3. tab terminal switching: the Alt + n-(n-= 1,2 ...);
4. Edit command mode switch mode: (. 1) I : inserted before the cursor; (2) the I : in which the cursor is first inserted trekking (. 3) A : inserted after the cursor; A : trekking tail which is inserted at the cursor; O : cursor row line which opens downwardly; O : open down one line in which the cursor line.
5. Insert mode / line mode switch command mode: the ESC ;
6. The command mode switch line mode: " : " WQ - save and exit, W - save, Q! - without saving, forced logout;
7. command mode instruction:
cursor movement commands
(1) H, J, K , L on the lower left to the right the cursor
(2) M the cursor to the middle line
(. 3) L cursor to the last line of the screen the first row
(4) G cursor to a specified row, -n (n is the number of rows) // number of input lines and then input to G
(. 5) turn down the Ctrl + D half screen
(6) Ctrl + u turned upward half screen
(7) Ctrl + f turn down a screen
(8) Ctrl + b turned up one screen
(9) gg = G // gg automatic layout retracted to the first file, G to end of file
delete command
(1) x: delete a cursor, corresponding to delete
(2) X-: before deleting a cursor, corresponding to Backspace
(. 3) dd: delete the line where the cursor, the cursor is deleted after dd n n lines
(4) D: the line When you delete a cursor, including a cursor position
(5) d0: delete the contents before the cursor line, does not include a cursor;
(. 6) DW: delete the cursor start position word (note the word), includes a cursor
revocation command
(1) U: withdrawn step by step
(2) U: disposable undo command before (doubtful)
(. 3) the Ctrl + R & lt: anti undo
repeat command
. : repeat the last command operating
line of text moves:
(1) << : left
(2) >>: right
copy paste:
(. 1) YY: YY copy copy the current line n n rows
(2) P: the cursor on the next line open space paste
visual mode :( a high use frequency)
( 1) v: moving by character
(2) V: moving rows, binding D (delete), y (copy), >>, << realize other operations
Alternatively:
(. 1) R & lt: for Change the current character
(2) R: Replace the current character cursor line corresponds to a knock r, a replacement character, will want to replace the next repeat, and R is the press once, can replace all the way to the back row of characters until the ESC key is pressed or the end of the line
focus to slightly! ! ! See man page
to move the cursor to the desired function to see, Shift + K
. 3 + Shift + K See man 3 page
view macro definitions:
Move the cursor to the desired content, [+ d to

 

Guess you like

Origin www.cnblogs.com/swoa/p/11260856.html