How do I delete the character before the cursor?
Answer
X
Explanation
The X command deletes the character to the left of the cursor (before it). It is the backspace equivalent in normal mode.
How it works
Xdeletes one character to the left- The cursor moves left to fill the gap
- Accepts a count:
3Xdeletes 3 characters to the left
Example
hello
With the cursor on o, pressing X deletes l:
helo
Tips
xdeletes the character under the cursor (forward delete)Xis the backward version5Xdeletes 5 characters to the left- In visual mode,
xandXboth delete the selection