Normal Mode (2) – Delete
There are several ways to delete characters in Normal mode.
x or backspace (delete + fn on Mac) : delete the character under the cursor
dd : delete the line under the cursor
ndd : delete multiple lines (current line and lines below). n is the number of lines that you want to delete. For example, if you want to delete the current line and the line below, type 2dd.
d^ : delete characters from the beginning of the line to the current character
d$ : delete characters from the current character to the end of the line
dG : delete lines from the current line to the last line
Tips: Deleting actions in Insert mode
- In Insert mode, you cannot use these delete keyboard actions except backspace (delete + fn on Mac).
- In Normal mode, you cannot use the delete key; however, you can use it in the Insert mode