Questions tagged [quit]

Use this tag for questions about exiting vim.

This tag is for questions about closing the vim text editor. From troubleshooting problems closing it, to configuring what happens when you close it.

By default, there are three ways to exit vim from normal mode:

  • :q<cr> This will quit without saving. If there are unsaved changes, you must add an exclamation mark to force it: :q!<cr>

  • :x<cr> This will quit and save.

  • ZZ This is just a synonym of :x<cr>

If you are using graphical vim (Gvim), you may also quit by clicking on the exit button on the window.

45 questions
30
votes
5 answers

How do I close Vim externally?

Let's say I have a X11 server that's hanging, keeping me from saving the work from the XTerm Vim session that X11 server controls. (Not GVim, just regular Vim-in-XTerm.) Is there a way that I could (from a different terminal) tell the running Vim…
DevSolar
  • 789
  • 1
  • 7
  • 15
7
votes
1 answer

How to safely quit vim if there's some unsaved changes?

If I have changed a bunch of files but without saving and maybe I have another pile of noname buffers which are changed and without a file name. I want vim to prompt confirmation for each one of the above files. if it's a changed file without saving…
Aaron Shen
  • 2,519
  • 3
  • 24
  • 37
4
votes
2 answers

What is this strange area, and how do I exit out of it

Seems to be related to this question What is the '[Command Line]' that sometimes comes up when I try to quit, and how can I quickly exit it?, but the solution doesn't work for me. I pressed esc, typed :q, q but nothing seems to work. The…
Samaursa
  • 171
  • 7
1
vote
2 answers

Why do I need to use q! after `find ... | vim -`, i.e., reading from stdin?

I do find $HOME -type f -name "*.tex" -exec grep -il "$1" {} + | vim - I cannot exit vim with q only because it gives the error which I do not understand why E37: No write since last change (add ! to override) So you have to do q! instead.…