Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to interrupt a Vim command taking too much time?

Tags:

vim

Sometimes a Vim command takes too much time to execute.

Typical example : gf command with a huge path over a network. It can take up to 30 seconds to end. I would like to interrupt the execution while it is ongoing.

Is there a way to cancel the command execution and go back to normal mode (without having to kill Vim and restart) ?

like image 763
Xavier T. Avatar asked Feb 15 '11 15:02

Xavier T.


2 Answers

You can interrupt it sending SIGINT (CTRL+C).

like image 73
Andrea Spadaccini Avatar answered Nov 18 '22 04:11

Andrea Spadaccini


From the documentation:

CTRL-C      Interrupt current (search) command.  Use CTRL-Break on
            MS-DOS |dos-CTRL-Break|.
            In Normal mode, any pending command is aborted.
like image 40
ire_and_curses Avatar answered Nov 18 '22 06:11

ire_and_curses