how can i get out of vi editor when esc won't work? how can i get out of vi editor when esc won't work? unix unix

how can i get out of vi editor when esc won't work?


There are few more commands for that apart from the one you are using

  1. Shift+zz to save (if modified )and exit
  2. :cq quit without writing

EDIT : I found some more commands that I just learned .

There are many ways to exit from vi editors, and you can use some of these commands to exit from other editors

  1. Press F2, this will drop you in Insert Mode, now press: q and hit enter
  2. another way is to press Ctrl + c or ctrl + z command to exit the vi editor forcefully.
  3. press ZZ (shift+z+z). it will save and exit.
  4. Ctrl + [ will also work like escape key.

the 3rd , and 6th command may or may not work on every system, as it depends on terminal's setting and system itself.

or you can do map certain keys to behave like escape, please refer this post , that will save you some keystrokes.


have you tried ESC then "ZZ"?seems to work as a last result for me.


Have you tried ^z followed by "kill" the process?