You are not logged in.
I keep closing VIM accidentally using the key binding that triggers the killclient in DWM so I was hoping to modify that function in order to allow for an exception. The function is given below:
killclient(const Arg *arg)
{
if (!selmon->sel)
return;
if (!sendevent(selmon->sel, wmatom[WMDelete])) {
XGrabServer(dpy);
XSetErrorHandler(xerrordummy);
XSetCloseDownMode(dpy, DestroyAll);
XKillClient(dpy, selmon->sel->win);
XSync(dpy, False);
XSetErrorHandler(xerror);
XUngrabServer(dpy);
}
}I would then only be able to close VIM using its inbuilt commands (such as :q).
Can somebody explain to me how I would have to modify the function above to make an exception for VIM? I don't run into the same problem with other programs as they, unlike VIM, usually require me to confirm that I want to close this window.
Offline
Just rebind killclient to something you are unlikely to use inadvertently.
Offline
Well, running code in VIM frequently opens up plots that I like to close using that key binding, so rebinding would probably not solve my issue
Offline