Console vim quitting without confirmation

asked 2013-12-16 11:43:42 +0000

simendsjo gravatar image

updated 2013-12-16 13:26:20 +0000

mod+shift+q quits an application. Most application hooks into this, but it doesn't seem to work when using console vim. I suspect this might be because I'm launching it using urxvt: bindsym $mod+Shift+v exec urxvtc -e vim

So.. Is there a way to let urxvt pipe the quit over to the console application that is open?

EDIT: A fix is to use gvim rather than vim, just turning off all gui elements. This works as expected, although the question is still the same for all curses applications I guess.

EDIT2: Setting some guioptions makes gvim look more like vim. For future reference, here are my settings so far:

if has("gui_running")
    " For console vim, this is handled by setting font for urxvt in .XResources
    set guifont=Source\ Code\ Pro\ Medium\ 12
    set guioptions-=m " Remove menu
    set guioptions-=T " Remove toolbar
    set guioptions-=r " Remove right scrollbar
    set guioptions-=e " Use curses rendering for tab pages
    set guioptions+=c " Use curses for simple dialog boxes
    set guioptions-=i " No vim icon
    set guioptions-=L " No left scrollbar
    set langmenu=en_US.utf-8
    language C " language for menus
    winpos 0 0 " Startup window position - not neccessary for all OSes/WMs
endif
edit retag flag offensive close merge delete

Comments

Maybe it's because you are using urxvt in deamon mode. On my machine if I open vim from a normal urxvt, both programs (vim + urxvt) getting closed after pressing mod+shift+q.

cee gravatar imagecee ( 2013-12-16 12:41:13 +0000 )edit

I get the exact same behavior when running non-deamon mode. The problem isn't that vim isn't closed (it is), the problem is that there are no confirmation about unsaved buffers. So vim is just killed. I would rather have it worked like I typed ":q" in vim before trying to kill anything.

simendsjo gravatar imagesimendsjo ( 2013-12-16 12:46:16 +0000 )edit

OK, now I get it.. Unfortunately no idea to solve this problem right now. I just stick to ZZ and then close urxvt

cee gravatar imagecee ( 2013-12-16 13:07:34 +0000 )edit

Ok, thanks anyway. Setting some guioptions makes gvim look and behave much like vim, so I might just stick with that.

simendsjo gravatar imagesimendsjo ( 2013-12-16 13:21:30 +0000 )edit