Normal Mode (2) – Delete
![Deleting Text in Vim Editor Normal Mode](/_next/image/?url=https%3A%2F%2Fstatic.d-libro.com%2F01-course-content-images%2F2011-10-Linux-Introduction%2F010-main-figures%2Fnormal-mode-2-delete-id201110030410.webp&w=1920&q=75)
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