11

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?

9

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 Mar 29 '16 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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