Search code examples
vim

vim - can not exit with usual command


:I have opened a file with vim on a so far unknown Linux server. What happens now is, I can not close the file or do anything. Usually, I can exit with escape q ! ENTER, but when I do this, I get the error:

E21: cannot make changes 'modifiable' is off

I get the same notice when I write anything else and press Enter. I simply cannot exit vim, even with Ctrl-C.


Solution

  • Just press ZQ. Note: they are both uppercase. so it is Shift+z,Shift+q. This is equivalent to :q! which you should use instead of q!