all repos — nixfiles @ a9cbb254fb271f75e865ad7f5673c39b58c444bb

System and user configuration, managed by nix and home-manager

emacs: use consult commands to replace/enhance other packages
Alan Pearce alan@alanpearce.eu
Mon, 17 Apr 2023 22:12:19 +0200
commit

a9cbb254fb271f75e865ad7f5673c39b58c444bb

parent

0f6e5efe6b8d2418fef02755dae1ae2c1bb823e8

2 files changed, 9 insertions(+), 12 deletions(-)

jump to
M user/emacs/init.eluser/emacs/init.el
@@ -249,6 +249,14 @@ completion-styles '(flex substring basic) 			completion-category-defaults nil
 			completion-category-overrides '((file (styles basic partial-completion))))
 
+(use-package consult
+  :general (:keymaps 'projectile-command-map
+                     "b" #'consult-project-buffer
+                     "s s" #'consult-ripgrep
+                     "s r" #'consult-ripgrep)
+  :general ([remap isearch-forward] #'consult-line
+            [remap isearch-backward] #'consult-line))
+
 (use-package smerge-mode
   :after magit
   :config
@@ -288,10 +296,6 @@ ("q" nil "cancel" :color blue))   :hook (magit-diff-visit-file . (lambda ()
                                    (when (bound-and-true-p smerge-mode)
                                      (unpackaged/smerge-hydra/body)))))
-
-(use-package ctrlf
-  :init (ctrlf-mode +1))
-
 
 ;;; Windows
 
@@ -943,11 +947,6 @@ (evil-ex-define-cmd "pesh[ell]" #'projectile-run-eshell)               (evil-ex-define-cmd "pb" #'projectile-switch-to-buffer)
               (evil-ex-define-cmd "psw[itch]" #'projectile-switch-project))))
 
-(use-package counsel-projectile
-  :general (:keymaps 'projectile-command-map
-                     "s s" #'counsel-projectile-rg
-                     "s r" #'counsel-projectile-rg))
-
 (use-package envrc
   :defer 2
   :after projectile
@@ -1185,7 +1184,7 @@ "v" #'split-window-right   "o" #'other-window
   "u" #'universal-argument
   ";" #'execute-extended-command
-  "bb" #'switch-to-buffer
+  "bb" #'consult-switch-buffer
   "bx" #'kill-this-buffer
   "br" #'revert-buffer
   "bk" #'kill-buffer
M user/settings/emacs.nixuser/settings/emacs.nix
@@ -91,9 +91,7 @@ company-shell         consult
         consult-eglot
         counsel
-        counsel-projectile
         crux
-        ctrlf
         dired-git-info
         envrc
         editorconfig