Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use gvim on windows very frequently. I have in my .vimrc:

set confirm

However, this opens a little dialog box, so I have to use my mouse to quit. In command line vim, I get this:

:q
Save changes to "Untitled"?
[Y]es, (N)o, (C)ancel:

Is there anyway I can configure gvim to behave this way?

share|improve this question
up vote 8 down vote accepted

That's a good question actually: I had never thought of this before but I added this setting now that I searched for it :-)

From :h gui-w32-dialogs:

6.1 Dialogs

The dialogs displayed by the "confirm" family (i.e. the 'confirm' option, :confirm command and confirm() function) are GUI-based rather than the console-based ones used by other versions. The 'c' flag in 'guioptions' changes this.

So using this in your .vimrc will do the trick:

set guioptions+=c
share|improve this answer
1  
Thanks, that was exactly what I needed! – DJ McMayhem Mar 29 at 16:02
1  
I can confirm this works for MacVim/mvim as well. – AbePralle Mar 29 at 21:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.