How do I exit the Vim editor?

后端 未结 10 2662
青春惊慌失措
青春惊慌失措 2020-11-22 02:26

I\'m stuck and cannot escape. It says:

\"type :quit to quit VIM\"

But when I type that it simply appears in the object body.

10条回答
  •  佛祖请我去吃肉
    2020-11-22 03:05

    If you want to quit without saving in Vim and have Vim return a non-zero exit code, you can use :cq.

    I use this all the time because I can't be bothered to pinky shift for !. I often pipe things to Vim which don't need to be saved in a file. We also have an odd SVN wrapper at work which must be exited with a non-zero value in order to abort a checkin.

提交回复
热议问题