From 73bac82db3901e33f00e1cb02662dd0d56184eb7 Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Sun, 21 Aug 2022 02:54:32 +0200 Subject: Emacs: Add custom buffer switch --- Emacs.org | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Emacs.org b/Emacs.org index 962a810..218229e 100644 --- a/Emacs.org +++ b/Emacs.org @@ -228,6 +228,12 @@ #+begin_src emacs-lisp + (defun jd/switch-buffer () + (interactive) + (let ((completion-regexp-list '("\\`[^*]" + "\\`\\([^T]\\|T\\($\\|[^A]\\|A\\($\\|[^G]\\|G\\($\\|[^S]\\|S.\\)\\)\\)\\).*"))) + (call-interactively 'counsel-switch-buffer))) + (use-package counsel) (use-package ivy :diminish @@ -240,7 +246,7 @@ ("C-k" . ivy-previous-line)) :config (ivy-mode 1)) - + #+end_src *** Keybinds @@ -252,7 +258,8 @@ "tt" '(counsel-load-theme :which-key "Choose theme")) (jd/leader-key-def - "bb" '(counsel-switch-buffer :which-key "Buffer switch") + "bb" '(jd/switch-buffer :which-key "Buffer switch") + "ba" '(counsel-switch-buffer :which-key "Buffer switch") "b" '(:ignore t :which-key "Buffer") "," '(counsel-switch-buffer :which-key "Buffer switch")) -- cgit v1.2.3