Press the v key, press the shift and arrow keys, select a few lines, and then press the x key to delete.
This kind of deletion does not delete the line selected by the cursor. How to delete the line selected by the cursor in vim (not gvim)?
世界只因有你2017-05-16 16:35:51
dd can delete the line where the current cursor is located. If you want to delete multiple lines, you can add the number of the line to be deleted in front of dd
迷茫2017-05-16 16:35:51
In addition to the two people above, there is also a way to delete the content after the cursor in the line, press dt$
PHP中文网2017-05-16 16:35:51
Shift + v is to select by row, ctrl + v is to select by block (select by column), then x and d can be deleted, similar to cutting, you can also use p to paste back.
x alone deletes the current character, dd deletes the current line, and adding a number in front means repeating it N times.
为情所困2017-05-16 16:35:51
In normal mode, you can use the x command to delete a single character, and the d command to delete more characters: d motion
.
motion is a command indicating the operating range. For the motions that appear in the following content, please refer to the table here:
Button | Definition
| Position the cursor at the beginning of the line
$ | Position the cursor to the end of the line
b | Position the cursor to the beginning of the word under the cursor
e | Position the cursor to the end of the word under the cursor
w | Position the cursor to the beginning of the next word
gg | Position the cursor to the beginning of the file
G | Position the cursor to the end of the file
If you want to delete more characters, you can use the c command: c motion
, which is similar to the d command. The difference is that after deletion, you enter insert mode.