From 93035ced81aa27fa7157c506173ee957db5a9a68 Mon Sep 17 00:00:00 2001 From: laurensmiers Date: Tue, 2 Jan 2018 16:31:56 +0100 Subject: [PATCH] Add kill-other-buffers function --- custom/setup-general.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/custom/setup-general.el b/custom/setup-general.el index afcb29b..9272bbf 100644 --- a/custom/setup-general.el +++ b/custom/setup-general.el @@ -52,6 +52,14 @@ (put 'narrow-to-page 'disabled nil) (put 'narrow-to-region 'disabled nil) +;; quick function to kill all other buffers +(defun kill-other-buffers () + "Kill all other buffers." + (interactive) + (mapc 'kill-buffer + (delq (current-buffer) + (remove-if-not 'buffer-file-name (buffer-list))))) + ;; screw with vi(m)-users (defconst wq "This is not vi! Use C-x C-c instead.") (defconst w "This is not vi! Use C-x C-s instead.")