From 2d05e54d351cedbaff95a91f720b43851b9bc980 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Thu, 25 Aug 2016 21:53:05 -0400 Subject: Add projectile-kill-other-buffers command --- init.el | 1 + lisp/km-projectile.el | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/init.el b/init.el index 99d946b..82a2eef 100644 --- a/init.el +++ b/init.el @@ -795,6 +795,7 @@ ("." . km/projectile-copy-project-filename-as-kill) ("e" . km/projectile-restore-thing) ("k" . km/projectile-kill-buffers) + ("K" . km/projectile-kill-other-buffers) ("v" . km/projectile-view-file) ("w" . km/projectile-save-thing)) diff --git a/lisp/km-projectile.el b/lisp/km-projectile.el index f2342a4..79666d5 100644 --- a/lisp/km-projectile.el +++ b/lisp/km-projectile.el @@ -179,5 +179,15 @@ Like `projectile-kill-buffers', but (cl-letf (((symbol-function 'yes-or-no-p) (lambda (&rest args) t))) (projectile-kill-buffers))) +;;;###autoload +(defun km/projectile-kill-other-buffers () + "Kill all project buffers except the current one." + (interactive) + (let ((cbuf (current-buffer))) + (mapc #'kill-buffer + (cl-remove-if + (lambda (b) (or (buffer-base-buffer b) (eq cbuf b))) + (projectile-project-buffers))))) + (provide 'km-projectile) ;;; km-projectile.el ends here -- cgit v1.2.3