diff options
author | jdlugosz963 <jdlugosz963@gmail.com> | 2022-08-21 02:54:32 +0200 |
---|---|---|
committer | jdlugosz963 <jdlugosz963@gmail.com> | 2022-08-21 02:54:32 +0200 |
commit | 73bac82db3901e33f00e1cb02662dd0d56184eb7 (patch) | |
tree | 33ea853c668b8316928cf14be521a0a2b60bebfd /Emacs.org | |
parent | b92d691698965269a6f79cec667e0561e7276b02 (diff) | |
download | dotfiles-73bac82db3901e33f00e1cb02662dd0d56184eb7.tar.gz dotfiles-73bac82db3901e33f00e1cb02662dd0d56184eb7.zip |
Emacs: Add custom buffer switch
Diffstat (limited to 'Emacs.org')
-rw-r--r-- | Emacs.org | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -228,6 +228,12 @@ | |||
228 | 228 | ||
229 | #+begin_src emacs-lisp | 229 | #+begin_src emacs-lisp |
230 | 230 | ||
231 | (defun jd/switch-buffer () | ||
232 | (interactive) | ||
233 | (let ((completion-regexp-list '("\\`[^*]" | ||
234 | "\\`\\([^T]\\|T\\($\\|[^A]\\|A\\($\\|[^G]\\|G\\($\\|[^S]\\|S.\\)\\)\\)\\).*"))) | ||
235 | (call-interactively 'counsel-switch-buffer))) | ||
236 | |||
231 | (use-package counsel) | 237 | (use-package counsel) |
232 | (use-package ivy | 238 | (use-package ivy |
233 | :diminish | 239 | :diminish |
@@ -240,7 +246,7 @@ | |||
240 | ("C-k" . ivy-previous-line)) | 246 | ("C-k" . ivy-previous-line)) |
241 | :config | 247 | :config |
242 | (ivy-mode 1)) | 248 | (ivy-mode 1)) |
243 | 249 | ||
244 | #+end_src | 250 | #+end_src |
245 | 251 | ||
246 | *** Keybinds | 252 | *** Keybinds |
@@ -252,7 +258,8 @@ | |||
252 | "tt" '(counsel-load-theme :which-key "Choose theme")) | 258 | "tt" '(counsel-load-theme :which-key "Choose theme")) |
253 | 259 | ||
254 | (jd/leader-key-def | 260 | (jd/leader-key-def |
255 | "bb" '(counsel-switch-buffer :which-key "Buffer switch") | 261 | "bb" '(jd/switch-buffer :which-key "Buffer switch") |
262 | "ba" '(counsel-switch-buffer :which-key "Buffer switch") | ||
256 | "b" '(:ignore t :which-key "Buffer") | 263 | "b" '(:ignore t :which-key "Buffer") |
257 | "," '(counsel-switch-buffer :which-key "Buffer switch")) | 264 | "," '(counsel-switch-buffer :which-key "Buffer switch")) |
258 | 265 | ||