Why does :q delete the window

Titus von der Malsburg malsburg at gmail.com
Mon Sep 3 10:02:31 CEST 2012


What :q and :wq should do in Evil is a matter of taste.  I redefined
them (in init.el) to only close the buffer and leave the window
untouched.  See below.

  Titus

(evil-define-command evil-quit (&optional bang)
  "Closes the current buffer."
  :repeat nil
  (interactive "<!>")
  (when bang
    (set-buffer-modified-p nil))
  (kill-this-buffer))

(evil-define-command evil-save-and-close (file &optional bang)
  "Saves the current buffer and closes the window."
  :repeat nil
  (interactive "<f><!>")
  (evil-write nil nil nil file bang)
  (evil-quit bang))


On Mon, Sep 3, 2012 at 9:28 AM, Guido Van Hoecke <guivho at gmail.com> wrote:
> Hi,
>
> I usualy have a 2x2 window configuration for my Emacs frame.
> My evil-version is 0.1 and my emacs is
> GNU Emacs 24.2.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
>  of 2012-08-27 on bob.porkrind.org
>
> Anybody has an idea why :q or :wq not only gets rid of the buffer, but
> also of the window?
>
> Editing a file in window 2 with following configuration
>
> -1- -2-
> -3- -4-
>
> and doing :q in -2- I end up with configuration
>
> ---1---
> -3- -4-
>
> This is rather annoying.
>
> Any pointers?
>
> TIA,
>
>
> Guido
>
> --
> No one knows like a woman how to say
> things that are at once gentle and deep.
>                 -- Hugo
>
> http://vanhoecke.org ... and go2 places!
>
> _______________________________________________
> implementations-list mailing list
> implementations-list at lists.ourproject.org
> https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list



-- 
Titus von der Malsburg
DFG Research Group 868: Mind and Brain Dynamics
Dept. of Linguistics, University of Potsdam
http://www.ling.uni-potsdam.de/~malsburg/



More information about the implementations-list mailing list