From 284b709c3c60698409cda352d494d057dff6ef7d Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Fri, 12 Aug 2022 21:23:55 +0100 Subject: (Emacs)~reordered ivy/counsel blocks, ~better defer patterns Set orderless ivy integration in orderless package rather than ivy for better deferral. Set counsel-grep-swiper-limit to ~1.5MB because swiper usually can handle it and I really don't like counsel-grep as I need to put in at least two characters to get a result back. --- Emacs/.config/emacs/config.org | 66 ++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 32 deletions(-) (limited to 'Emacs/.config') diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index c5d27c9..2b9c7a2 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -454,7 +454,9 @@ Orderless sorting method for completion, probably one of the best things ever. #+begin_src emacs-lisp (use-package orderless - :after (ivy ido)) + :after (ivy ido) + :config + (setf (alist-get t ivy-re-builders-alist) 'orderless-ivy-re-builder)) #+end_src *** Ido :PROPERTIES: @@ -524,44 +526,15 @@ with more text based functions. Ivy is a completion framework for Emacs, and my preferred (sometimes second favourite) one. It has a great set of features with little to no pain with setting up. -**** Counsel -Setup for counsel. Load after ivy and helpful. - -Along with that, set the help function and variable functions to their -helpful counterparts. -#+begin_src emacs-lisp -(use-package counsel - :general - (leader - "ss" #'counsel-grep-or-swiper - "sr" #'counsel-rg - "fr" #'counsel-recentf - "ic" #'counsel-unicode-char) - :init - (general-def - [remap describe-bindings] #'counsel-descbinds - [remap load-theme] #'counsel-load-theme) - :config - (setq ivy-initial-inputs-alist nil - counsel-describe-function-function #'helpful-callable - counsel-describe-variable-function #'helpful-variable - ivy-re-builders-alist '((swiper . ivy--regex-plus) - (counsel-grep-or-swiper . ivy--regex-plus) - (counsel-rg . ivy--regex-plus) - (t . orderless-ivy-re-builder))) - (with-eval-after-load "org-mode" - (general-def - [remap org-goto] #'counsel-org-goto)) - (counsel-mode)) -#+end_src **** Ivy Core Setup for ivy, in preparation for counsel. Turn on ivy-mode just after init. -Setup vim-like bindings for the minibuffer ("C-(j|k)" for down|up the +Setup vim-like bindings for the minibuffer ("M-(j|k)" for down|up the selection list). #+begin_src emacs-lisp (use-package ivy + :defer t :hook (after-init-hook . ivy-mode) :general (general-def @@ -586,6 +559,34 @@ selection list). (with-eval-after-load "amx" (setq amx-backend 'ivy))) #+end_src +**** Counsel +Setup for counsel. Load after ivy and helpful. + +Along with that, set the help function and variable functions to their +helpful counterparts. +#+begin_src emacs-lisp +(use-package counsel + :after ivy + :general + (leader + "ss" #'counsel-grep-or-swiper + "sr" #'counsel-rg + "fr" #'counsel-recentf + "ic" #'counsel-unicode-char) + (general-def + [remap describe-bindings] #'counsel-descbinds + [remap load-theme] #'counsel-load-theme) + :config + (setq ivy-initial-inputs-alist nil + counsel-describe-function-function #'helpful-callable + counsel-describe-variable-function #'helpful-variable + counsel-grep-swiper-limit 1500000 + ivy-re-builders-alist '((swiper . ivy--regex-plus) + (counsel-grep-or-swiper . ivy--regex-plus) + (counsel-rg . ivy--regex-plus) + (t . ivy--regex-ignore-order))) + (counsel-mode)) +#+end_src **** Counsel etags :PROPERTIES: :header-args:emacs-lisp: :tangle no @@ -1172,6 +1173,7 @@ Basic setup that replaces commands and configures =display-buffer-alist= for helpful. #+begin_src emacs-lisp (use-package helpful + :after ivy :commands (helpful-callable helpful-variable) :general (general-def -- cgit v1.2.3-13-gbd6f