bruin
bruin

Reputation: 1231

Vim delete to the end of the current line but keep the character under the cursor

Is there a way to map a shortcut to delete to the end of the line, but keep the character under the cursor? D also deletes the character under the cursor. C followed by the character and <ESC> requires more strokes...

Upvotes: 0

Views: 91

Answers (1)

DJMcMayhem
DJMcMayhem

Reputation: 7689

You could just map D to lD with

nnoremap D lD

But since it will only save you one keystroke, I'd recommend just training your fingers to make the edit you're going for.

Upvotes: 3

Related Questions