From 72c21307204f4dc6e23d667876976929ed79de03 Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Sat, 13 Aug 2022 16:26:16 +0200 Subject: Emacs: Add kill-other-buffers function --- Emacs.org | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Emacs.org') diff --git a/Emacs.org b/Emacs.org index 8605870..a6d5867 100644 --- a/Emacs.org +++ b/Emacs.org @@ -274,8 +274,16 @@ #+begin_src emacs-lisp + (defun jd/kill-other-buffers () + (interactive) + (dolist (buffer (buffer-list)) + (when (not (equal (current-buffer) buffer)) + (kill-buffer buffer))) + (delete-other-windows)) + (jd/leader-key-def - "bk" '(kill-this-buffer :which-key "Buffer kill")) + "bk" '(kill-this-buffer :which-key "Kill buffer") + "bK" '(jd/kill-other-buffers :which-key "Kill other buffers")) #+end_src -- cgit v1.2.3