diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/init-buffers.el | 15 |
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) |