Luke Davis
Luke Davis

Reputation: 2666

VIM: Is it possible to exit/cancel "colon command" line using just 1 keystroke/shortcut?

Sometimes I start to search and replace something with :%s/string/..., then quickly change my mind. Or, maybe I am manipulating my tabs. I want to quickly return to the cursor position I just left.

Is there a way to cancel that command/go back to the editor using a single shortcut? It's kind of tedious having to just backspace through the command.

Obviously this is very nit picky, but perhaps the answer is simple.

Upvotes: 1

Views: 949

Answers (4)

joing
joing

Reputation: 139

ESC key should also work. More vimish :)

Upvotes: 0

Destructor
Destructor

Reputation: 523

Just press CTRL+C which will abort the command.

Upvotes: 1

TessellatingHeckler
TessellatingHeckler

Reputation: 28983

Ctrl+c


:help CTRL-C

                                                    CTRL-C
CTRL-C              Interrupt current (search) command.  Use CTRL-Break on
                    MS-DOS dos-CTRL-Break.
                    In Normal mode, any pending command is aborted.

Upvotes: 4

Sash Sinha
Sash Sinha

Reputation: 22360

Use Ctrl+C to abort the current command.

Upvotes: 4

Related Questions