vim text editor - delete, copy, cut

1. Delete:

(1) at the cursor to delete characters:

 

 As shown above: click on the x button only once to delete a character.

(2) Delete the cursor is located at the rear of n characters (nx):

Before deleting:

 

 Input 6x:

 

 (3) Remove cursor line (dd):

Before deleting:

 

 Enter the delete command dd:

 

 The back of the line will automatically advance.

(4) Delete n lines (ndd):

Before deleting:

 

 Input 3dd:

Input 3dd:

 

 (5) delete the contents of the cursor line to the end of the file:

Before deleting:

 

 Delete After:

 

 (6) Remove the cursor at the end of the line elements:

 

 (7) Delete rows within the specified range:

Before deleting:

 

 Delete After:

 

 2. Copy:

(1) copies the current line (yy), attached at the current cursor row or rows (p) (P):

 

 (2) copy multiple lines (nyy):

 

 3yy: Copy 3 rows, row containing the cursor.

With p or P to complete replication.

3. Cut:

(1) the current line (dd):

 

 After entering the dd command, the cursor line disappear:

 

 P-P binding or shearing operation complete command:

(2) the current line of the following n rows (comprising cursor line):

 

 Enter a command to complete the paste p:

 

 ---

 

 

Guess you like

Origin www.cnblogs.com/zhai1997/p/11951003.html