From 1e3d991ce6c41e4433ec2ead586e616099a2d82a Mon Sep 17 00:00:00 2001 From: Rawley Fowler <75388349+rawleyfowler@users.noreply.github.com> Date: Sat, 28 May 2022 18:51:51 -0600 Subject: [PATCH] More fine tuning of :wq :q --- emacs.d/init.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/emacs.d/init.el b/emacs.d/init.el index 61e8365..93be21c 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -74,22 +74,20 @@ (evil-mode)) (defun selective-window-kill () - (when (< 2 (count-windows)) + (interactive) + (when (> (count-windows) 1) (delete-window))) -(defun save-and-kill-buffer () ;; Saves and kills a buffer, vim style +(defun save-kill-buffer () ;; Saves and kills a buffer, vim style (interactive) (save-buffer) - (kill-buffer) - (selective-window-kill)) - -(defun kill-buffer-and-window () - (interactive) - (kill-buffer) (selective-window-kill)) (evil-ex-define-cmd "wq" 'save-and-kill-buffer) -(evil-ex-define-cmd "q" 'kill-buffer-and-window) +(evil-ex-define-cmd "q" 'selective-window-kill) +(evil-ex-define-cmd "kb" '(lambda () + (interactive) + (kill-buffer-and-window))) (use-package evil-collection :after evil @@ -97,6 +95,8 @@ :config (evil-collection-init)) +(use-package evil-org) + ;; Project mangement (use-package projectile :config