From eede581862d46ccde4313ddb13b97e63082909ee Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 1 Feb 2015 18:11:47 -0500 Subject: Add kill buffer variant --- lisp/init-buffers.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lisp/init-buffers.el b/lisp/init-buffers.el index afdfe71..73a49ac 100644 --- a/lisp/init-buffers.el +++ b/lisp/init-buffers.el @@ -13,7 +13,20 @@ (save-buffer) (kill-this-buffer)) -(global-set-key (kbd "C-x K") 'kill-buffer-and-window) +(defun km/kill-buffer (&optional arg) + "Kill this buffer. +With single C-u, prompt for buffer to kill. With double C-u, +kill this buffer and the window." + (interactive "P") + (cond + ((not arg) + (kill-buffer)) + ((equal arg '(16)) + (kill-buffer-and-window)) + (t + (call-interactively #'kill-buffer)))) + +(global-set-key (kbd "C-x K") 'km/kill-buffer) (key-chord-define-global ",d" 'km/save-and-kill-buffer) (key-chord-define-global ",s" 'save-buffer) -- cgit v1.2.3