editing

x

Deletes the character under the cursor — Vim's equivalent of the Delete key. It's a cut, so the character lands in the unnamed register.

x  (normal mode)

Variations

Keystroke Effect
X Delete character BEFORE the cursor (like Backspace)
5x Delete 5 characters starting at cursor
xp Classic typo-swap: delete this char and paste it after (swaps with next char)

Examples

x

Delete character under cursor

3x

Delete 3 characters to the right

Xx

Delete the char before AND the char under the cursor

Gotcha

x won't cross line boundaries — hitting x on an empty line does nothing. On the last char of a line the cursor moves left after deletion.

Related

← All Vim commands · Vim cheat sheet