summaryrefslogtreecommitdiff
path: root/lisp/km-projectile.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-08-25 21:53:05 -0400
committerKyle Meyer <kyle@kyleam.com>2016-08-25 21:53:05 -0400
commit2d05e54d351cedbaff95a91f720b43851b9bc980 (patch)
treefb0977a763d9dd0f54822dfd10362c9278632ed9 /lisp/km-projectile.el
parent50672eb79ea19e813d370e7935c5b0d718e31d45 (diff)
downloademacs.d-2d05e54d351cedbaff95a91f720b43851b9bc980.tar.gz
Add projectile-kill-other-buffers command
Diffstat (limited to 'lisp/km-projectile.el')
-rw-r--r--lisp/km-projectile.el10
1 files changed, 10 insertions, 0 deletions
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