diff options
-rw-r--r-- | custom/jao-custom-completion.el | 1 | ||||
-rw-r--r-- | init.el | 11 |
2 files changed, 8 insertions, 4 deletions
diff --git a/custom/jao-custom-completion.el b/custom/jao-custom-completion.el index 5026a44..089da6b 100644 --- a/custom/jao-custom-completion.el +++ b/custom/jao-custom-completion.el @@ -218,7 +218,6 @@ :ensure t :bind (("C-x M-:" . consult-complex-command) ("C-x b" . consult-buffer) - ("C-x C-b" . consult-buffer) ("C-x 4 b" . consult-buffer-other-window) ("C-c b" . project-find-file) ("C-c h" . nil) @@ -1185,7 +1185,7 @@ ;;;; same mode (defun jao-buffer-same-mode (&optional mode pre-fn switch-fn) - (interactive "P") + (interactive) (let* ((mode (or mode major-mode)) (modes (if (symbolp mode) (list mode) mode)) (pred `(lambda (b) @@ -1194,8 +1194,13 @@ ',modes)))) (buff (read-buffer "Buffer: " nil t pred))) (when pre-fn (funcall pre-fn)) - (if switch-fn (funcall switch-fn buff) (pop-to-buffer buff)))) -(global-set-key (kbd "C-c C-b") #'jao-buffer-same-mode) + (if switch-fn (funcall switch-fn buff) (switch-to-buffer buff)))) + +(defun jao-buffer-same-mode-cmd (&optional pop) + (interactive "P") + (jao-buffer-same-mode nil nil (and pop #'pop-to-buffer))) + +(global-set-key (kbd "C-x C-b") #'jao-buffer-same-mode-cmd) ;;;; projects (use-package project :demand t) |