diff options
author | David Morgan <djm_uk@protonmail.com> | 2024-09-05 13:36:47 +0100 |
---|---|---|
committer | David Morgan <djm_uk@protonmail.com> | 2024-09-05 13:36:47 +0100 |
commit | 1c955d0f85f2ee7e9d89f548bb286ad3ba6f3461 (patch) | |
tree | ec7c5e5376ab194875eaaca6ddcea9786510b48e /.emacs.d | |
parent | d526b947cde6873d96072f0374a073b0e90e5de1 (diff) | |
download | dotfiles-1c955d0f85f2ee7e9d89f548bb286ad3ba6f3461.tar.gz |
Add iflipb-kill-current-buffer and swap bindings
Diffstat (limited to '.emacs.d')
-rw-r--r-- | .emacs.d/lisp/init-ui.el | 2 | ||||
-rw-r--r-- | .emacs.d/lisp/init-windows.el | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/.emacs.d/lisp/init-ui.el b/.emacs.d/lisp/init-ui.el index 0c12934..cb1c831 100644 --- a/.emacs.d/lisp/init-ui.el +++ b/.emacs.d/lisp/init-ui.el @@ -16,7 +16,7 @@ (global-display-line-numbers-mode) (global-hl-line-mode +1) - (global-set-key (kbd "C-x C-S-k") 'kill-this-buffer) + (global-set-key (kbd "C-x C-S-k") 'kill-buffer) (add-to-list 'custom-theme-load-path "~/.emacs.d/themes") (load-theme 'non-modo t))) diff --git a/.emacs.d/lisp/init-windows.el b/.emacs.d/lisp/init-windows.el index be6d902..fcf39cc 100644 --- a/.emacs.d/lisp/init-windows.el +++ b/.emacs.d/lisp/init-windows.el @@ -205,9 +205,21 @@ This is based on the frame width, with the threshold being customised using "Abort buffer flipping and return to the original buffer." (interactive) (iflipb-restore-buffers)) + (defun iflipb-kill-current-buffer () + "Same as `kill-current-buffer' but keep the iflipb buffer list state. + +Modified from `iflipb-kill-buffer'." + (interactive) + (call-interactively #'kill-current-buffer) + (if (iflipb-first-iflipb-buffer-switch-command) + (setq last-command 'kill-current-buffer) + (if (< iflipb-current-buffer-index (length (iflipb-interesting-buffers))) + (iflipb-select-buffer iflipb-current-buffer-index) + (iflipb-select-buffer (1- iflipb-current-buffer-index))) + (setq last-command 'iflipb-kill-current-buffer))) :custom (iflipb-buffer-list-function 'iflipb-persp-buffer-list) :bind - ("C-x k" . iflipb-kill-buffer) ;; TODO replace with a kill currently selected buffer command + ("C-x k" . iflipb-kill-current-buffer) ("<f12>" . iflipb-previous-buffer) ("<f11>" . iflipb-next-buffer) ("<f10>" . iflibp-abort)) |