How to abort vim opening a large file

keyboard shortcutsvim

When opening a very large file vim will sometimes take a long time and just show the black screen while it loads. Sometime I change my mind after opening and want to return to the command line without having to wait for vim to finish opening the file. How can I do this?

I've tried Ctrl+C and Ctrl+D and :q! and Ctrl+Z to no avail.

It seems to reject any keyboard input.

Best Answer

The following worked from a second shell. I'm running bash on Windows, and it also works for linux.

myuser@mycomp:/filepath$ ps-ef|grep vim 
myuser      21     4  0 21:16 tty1     00:00:00 vim 
myuser      38    23  0 21:16 tty2     00:00:00 grep vim 
myuser@mycomp:/filepath$  kill 21 
myuser@mycomp:/filepath$ 
Related Question