Matt Joiner
Matt Joiner

Reputation: 118490

Abort keystroke sequence?

When using Vim I sometimes find myself midway through entering a key combination and change my mind or realise it's incorrect (I'm still learning).

For example I may have typed d, 4 and be about to press d in order to delete 4 lines and realise this is not what I want to do. How can I abort the current sequence of keystrokes?

Upvotes: 11

Views: 3224

Answers (3)

Greg Sexton
Greg Sexton

Reputation: 9279

I prefer CTRL+[ over escape at all times, including aborting the current command. It's quicker and easier to type, particularly if you remap caps lock to ctrl.

Upvotes: 2

Greg Hewgill
Greg Hewgill

Reputation: 992955

Ctrl+C also aborts the current command.

Upvotes: 6

Felix Kling
Felix Kling

Reputation: 816364

Press ESC.

(no more text)

Upvotes: 8

Related Questions