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:

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

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

1 Answer 1


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
  • 1
    I can confirm this works for MacVim/mvim as well.
    – AbePralle
    Commented Mar 29, 2016 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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