Skip to main content
deleted 358 characters in body
Source Link
Heikki Naski
  • 2.7k
  • 2
  • 21
  • 13

This is the ultimate, no-nonsense, hardcore exit command for the worst-case scenarios of exiting Vim if you want out, have no idea what you've done and you don't care what will happen to the files you opened.

Ctrl-cEnterCtrl-\Ctrl-nEnter:qa!Enter

This will get you out most of the time. Most.

SomeYou might think, naively, that you can just bang Esc a few times and then do :qa!. Oh, how you would be mistaken.

See these interesting cases where you need something like thishitting Esc is not enough:

  • iCtrl-ovg (you enter insert mode, then visual mode and then operator pending mode)

  • QappendEnter

  • iCtrl-ogQCtrl-r=Ctrl-k (thanks to porges for this case)

  • iCtrl-ogQCtrl-r=inputdialog('foo','bar')Enter

  • :set insertmode (this is a case when Ctrl-\Ctrl-n returns you to normal mode)


This answer was corrected due to cases above. It used to be:

EscEscEsc:qa!Enter

However, that doesn't work if you have entered Ex mode. In that case you would need to do:

viEnter:qa!Enter

So a complete command for "I don't want to know what I've done and I don't want to save anything, I just want out now!" would be

viEnterEscEscEsc:qa!Enter

This is the ultimate, no-nonsense, hardcore exit command for the worst-case scenarios of exiting Vim if you want out, have no idea what you've done and you don't care what will happen to the files you opened.

Ctrl-cEnterCtrl-\Ctrl-nEnter:qa!Enter

This will get you out most of the time. Most.

Some interesting cases where you need something like this:

  • iCtrl-ovg (you enter insert mode, then visual mode and then operator pending mode)

  • QappendEnter

  • iCtrl-ogQCtrl-r=Ctrl-k (thanks to porges for this case)

  • iCtrl-ogQCtrl-r=inputdialog('foo','bar')Enter

  • :set insertmode (this is a case when Ctrl-\Ctrl-n returns you to normal mode)


This answer was corrected due to cases above. It used to be:

EscEscEsc:qa!Enter

However, that doesn't work if you have entered Ex mode. In that case you would need to do:

viEnter:qa!Enter

So a complete command for "I don't want to know what I've done and I don't want to save anything, I just want out now!" would be

viEnterEscEscEsc:qa!Enter

This is the ultimate, no-nonsense, hardcore exit command for the worst-case scenarios of exiting Vim if you want out, have no idea what you've done and you don't care what will happen to the files you opened.

Ctrl-cEnterCtrl-\Ctrl-nEnter:qa!Enter

This will get you out most of the time. Most.

You might think, naively, that you can just bang Esc a few times and then do :qa!. Oh, how you would be mistaken.

See these interesting cases where hitting Esc is not enough:

  • iCtrl-ovg (you enter insert mode, then visual mode and then operator pending mode)

  • QappendEnter

  • iCtrl-ogQCtrl-r=Ctrl-k (thanks to porges for this case)

  • iCtrl-ogQCtrl-r=inputdialog('foo','bar')Enter

  • :set insertmode (this is a case when Ctrl-\Ctrl-n returns you to normal mode)

added 161 characters in body
Source Link
Heikki Naski
  • 2.7k
  • 2
  • 21
  • 13

This is the ultimate, no-nonsense, hardcore exit command for the worst-case scenarioscenarios of exiting Vim if you just want out, have no idea what you've done and you don't care what will happen to the files you opened.

Ctrl-cEnterEnterviEnterCtrl-\Ctrl-nEnter:qa!Enter

This shouldwill get you out most of the time. Most.

Some interesting cases where you need something like this:

  • iCtrl-ovg (you enter insert mode, then visual mode and then operator pending mode)

  • QappendEnter

  • iCtrl-ogQCtrl-r=Ctrl-k (thanks to porges for this case)

  • iCtrl-ogQCtrl-r=inputdialog('foo','bar')Enter

  • :set insertmode (this is a case when Ctrl-\Ctrl-n returns you to normal mode)


This answer was corrected due to cases above. It used to be:

EscEscEsc:qa!Enter

However, that doesn't work if you have entered Ex mode. In that case you would need to do:

viEnter:qa!Enter

So a complete command for "I don't want to know what I've done and I don't want to save anything, I just want out now!" would be

viEnterEscEscEsc:qa!Enter

This is for the worst-case scenario of exiting Vim if you just want out, have no idea what you've done and you don't care what will happen to the files you opened.

Ctrl-cEnterEnterviEnterCtrl-\Ctrl-n:qa!Enter

This should get you out most of the time.

Some interesting cases where you need something like this:

  • iCtrl-ovg (you enter insert mode, then visual mode and then operator pending mode)

  • QappendEnter

  • iCtrl-ogQCtrl-r=Ctrl-k (thanks to porges for this case)

  • :set insertmode (this is a case when Ctrl-\Ctrl-n returns you to normal mode)


This answer was corrected due to cases above. It used to be:

EscEscEsc:qa!Enter

However, that doesn't work if you have entered Ex mode. In that case you would need to do:

viEnter:qa!Enter

So a complete command for "I don't want to know what I've done and I don't want to save anything, I just want out now!" would be

viEnterEscEscEsc:qa!Enter

This is the ultimate, no-nonsense, hardcore exit command for the worst-case scenarios of exiting Vim if you want out, have no idea what you've done and you don't care what will happen to the files you opened.

Ctrl-cEnterCtrl-\Ctrl-nEnter:qa!Enter

This will get you out most of the time. Most.

Some interesting cases where you need something like this:

  • iCtrl-ovg (you enter insert mode, then visual mode and then operator pending mode)

  • QappendEnter

  • iCtrl-ogQCtrl-r=Ctrl-k (thanks to porges for this case)

  • iCtrl-ogQCtrl-r=inputdialog('foo','bar')Enter

  • :set insertmode (this is a case when Ctrl-\Ctrl-n returns you to normal mode)


This answer was corrected due to cases above. It used to be:

EscEscEsc:qa!Enter

However, that doesn't work if you have entered Ex mode. In that case you would need to do:

viEnter:qa!Enter

So a complete command for "I don't want to know what I've done and I don't want to save anything, I just want out now!" would be

viEnterEscEscEsc:qa!Enter

Fixed formatting/escaping
Source Link
Nathan Tuggy
  • 2.2k
  • 27
  • 33
  • 38

This is for the worst-case scenario of exiting Vim if you just want out, have no idea what you've done and you don't care what will happen to the files you opened.

Ctrl--cEnterEnterviEnterCtrl-\Ctrl-</kbd>Ctrl-n:qa!Enter

n:qa!Enter

This should get you out most of the time.

Some interesting cases where you need something like this:

  • iCtrl-ovg (you enter insert mode, then visual mode and then operator pending mode)

  • QappendEnter

  • iCtrl-ogQCtrl-r=Ctrl-k (thanks to porges for this case)

  • :set insertmode (this is a case when Ctrl-\Ctrl-n returns you to normal mode)

 

This should get you out most of the timeanswer was corrected due to cases above. It used to be:

Some interesting cases whereEscEscEsc:qa!Enter

However, that doesn't work if you have entered Ex mode. In that case you would need something like thisto do:

  • iCtrl-ovg (you enter insert mode, then visual mode and then operator pending mode)

  • QappendEnter

  • iCtrl-ogQCtrl-r=Ctrl-k (thanks to porges for this case)

  • :set insertmode (this is a case when Ctrl-</kbd>Ctrl-n returns you to normal mode)


This answer was corrected due to cases above. It used to be:

EscEscEsc:qa!Enter

However, that doesn't work if you have entered Ex mode. In that case you would need to do:

viEnter:qa!Enter

So a complete command for "I don't want to know what I've done and I don't want to save anything, I just want out now!" would be

viEnterEscEscEsc:qa!Enter

viEnter:qa!Enter

So a complete command for "I don't want to know what I've done and I don't want to save anything, I just want out now!" would be

viEnterEscEscEsc:qa!Enter

This is for the worst-case scenario of exiting Vim if you just want out, have no idea what you've done and you don't care what will happen to the files you opened.

Ctrl-cEnterEnterviEnterCtrl-</kbd>Ctrl-n:qa!Enter

This should get you out most of the time.

Some interesting cases where you need something like this:

  • iCtrl-ovg (you enter insert mode, then visual mode and then operator pending mode)

  • QappendEnter

  • iCtrl-ogQCtrl-r=Ctrl-k (thanks to porges for this case)

  • :set insertmode (this is a case when Ctrl-</kbd>Ctrl-n returns you to normal mode)


This answer was corrected due to cases above. It used to be:

EscEscEsc:qa!Enter

However, that doesn't work if you have entered Ex mode. In that case you would need to do:

viEnter:qa!Enter

So a complete command for "I don't want to know what I've done and I don't want to save anything, I just want out now!" would be

viEnterEscEscEsc:qa!Enter

This is for the worst-case scenario of exiting Vim if you just want out, have no idea what you've done and you don't care what will happen to the files you opened.

Ctrl-cEnterEnterviEnterCtrl-\Ctrl-n:qa!Enter

This should get you out most of the time.

Some interesting cases where you need something like this:

  • iCtrl-ovg (you enter insert mode, then visual mode and then operator pending mode)

  • QappendEnter

  • iCtrl-ogQCtrl-r=Ctrl-k (thanks to porges for this case)

  • :set insertmode (this is a case when Ctrl-\Ctrl-n returns you to normal mode)

 

This answer was corrected due to cases above. It used to be:

EscEscEsc:qa!Enter

However, that doesn't work if you have entered Ex mode. In that case you would need to do:

viEnter:qa!Enter

So a complete command for "I don't want to know what I've done and I don't want to save anything, I just want out now!" would be

viEnterEscEscEsc:qa!Enter

Dragon::Supervised edit (descriptions not implemented)
Source Link
Loading
Active reading [<http://en.wikipedia.org/wiki/Vim_%28text_editor%29>]
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134
Loading
added 10 characters in body
Source Link
Heikki Naski
  • 2.7k
  • 2
  • 21
  • 13
Loading
added 16 characters in body
Source Link
Heikki Naski
  • 2.7k
  • 2
  • 21
  • 13
Loading
deleted 3 characters in body
Source Link
Heikki Naski
  • 2.7k
  • 2
  • 21
  • 13
Loading
added 290 characters in body
Source Link
Heikki Naski
  • 2.7k
  • 2
  • 21
  • 13
Loading
added 48 characters in body
Source Link
Heikki Naski
  • 2.7k
  • 2
  • 21
  • 13
Loading
Copy edited.
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134
Loading
added 27 characters in body
Source Link
Heikki Naski
  • 2.7k
  • 2
  • 21
  • 13
Loading
added 331 characters in body
Source Link
Heikki Naski
  • 2.7k
  • 2
  • 21
  • 13
Loading
Source Link
Heikki Naski
  • 2.7k
  • 2
  • 21
  • 13
Loading