summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-02-01 18:11:47 -0500
committerKyle Meyer <kyle@kyleam.com>2015-02-01 18:11:47 -0500
commiteede581862d46ccde4313ddb13b97e63082909ee (patch)
tree347c39ff97492de4b558450f08191de71631fea1 /lisp
parentb8124812952236e06d83b32e30e6d15e1b53f667 (diff)
downloademacs.d-eede581862d46ccde4313ddb13b97e63082909ee.tar.gz
Add kill buffer variant
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-buffers.el15
1 files changed, 14 insertions, 1 deletions
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)