refactor(tazjin/emacs): ivy,swiper,counsel -> vertico,consult
vertico and consult are more modern versions of interactive narrowing helpers, as those implemented by ivy and its related packages. The primary differences (and what I care about here) is that they are more focused on integration with the core Emacs primitives, rather than building an ecosystem around them. For example: * vertico enhances `completing-read' and friends, but does not attempt to provide its own ecosystem of functions to *trigger* completions. * vertico integrates with the default `completion-style' system, meaning that I can continue to use things like prescient without extra packages that integrate it with vertico * consult does not rely on vertico or any other specific completion framework (such as counsel/swiper do with ivy), and simply implements its functions using completing-read This reduces the overall amount of code in the dependency closure and leads to a less special setup. Functionality is basically equivalent, except for two things which counsel came with that I will need to substitute: * counsel-notmuch (actually this was a separate package, but I didn't use it much anyways, so just ignoring it for now) * counsel-linux-app (opening desktop shortcuts, this I will need to make) As a side note, consult notes "This package is a part of GNU Emacs", but it doesn't seem to be the case. Change-Id: Ia046b763bf3d401b505e0f6393cfe1ccd6f41293 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9155 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
		
							parent
							
								
									9afa1dacf8
								
							
						
					
					
						commit
						e78b79c6cd
					
				
					 6 changed files with 14 additions and 41 deletions
				
			
		|  | @ -36,9 +36,6 @@ | |||
| ;; Open a file in project: | ||||
| (global-set-key (kbd "C-c f") 'project-find-file) | ||||
| 
 | ||||
| ;; Search in a project | ||||
| (global-set-key (kbd "C-c r g") 'rg-in-project) | ||||
| 
 | ||||
| ;; Open a file via magit: | ||||
| (global-set-key (kbd "C-c C-f") #'magit-find-file-worktree) | ||||
| 
 | ||||
|  |  | |||
|  | @ -220,7 +220,7 @@ in-progress." | |||
| (exwm-input-set-key (kbd "C-c j") #'exwm-jump-to-buffer) | ||||
| 
 | ||||
| ;; Launch applications / any command with completion (dmenu style!) | ||||
| (exwm-input-set-key (kbd "s-d") #'counsel-linux-app) | ||||
| ;; (exwm-input-set-key (kbd "s-d") #'counsel-linux-app) ;; TODO(tazjin): completing-read version | ||||
| (exwm-input-set-key (kbd "s-x") #'run-external-command) | ||||
| (exwm-input-set-key (kbd "s-p") #'password-store-lookup) | ||||
| 
 | ||||
|  | @ -376,7 +376,6 @@ in-progress." | |||
| ;; Notmuch shortcuts as EXWM globals | ||||
| ;; (g m => gmail) | ||||
| (exwm-input-set-key (kbd "s-g m") #'notmuch) | ||||
| (exwm-input-set-key (kbd "s-g M") #'counsel-notmuch) | ||||
| 
 | ||||
| (exwm-randr-enable) | ||||
| 
 | ||||
|  |  | |||
|  | @ -281,14 +281,6 @@ by looking for a `Cargo.toml' file." | |||
|                              (magit-read-file-from-rev "HEAD" "Find file") | ||||
|                              #'pop-to-buffer-same-window)) | ||||
| 
 | ||||
| (defun rg-in-project (&optional prefix) | ||||
|   "Interactively call ripgrep in the current project, or fall | ||||
|   back to ripgrep default behaviour if prefix is set." | ||||
|   (interactive "P") | ||||
|   (counsel-rg nil (unless prefix | ||||
|                     (if-let ((pr (project-current))) | ||||
|                         (project-root pr))))) | ||||
| 
 | ||||
| (defun zoxide-open-project () | ||||
|   "Query Zoxide for paths, and open the result as appropriate (magit or dired)." | ||||
|   (interactive) | ||||
|  |  | |||
|  | @ -33,9 +33,10 @@ | |||
|   :hook ((prog-mode . company-mode)) | ||||
|   :config (setq company-tooltip-align-annotations t)) | ||||
| 
 | ||||
| (use-package counsel | ||||
|   :after (ivy) | ||||
|   :config (counsel-mode 1)) | ||||
| (use-package consult | ||||
|   :bind | ||||
|   ("C-c r g" . consult-ripgrep) | ||||
|   ("C-s" . consult-line)) | ||||
| 
 | ||||
| (use-package dash) | ||||
| (use-package gruber-darker-theme) | ||||
|  | @ -50,18 +51,6 @@ | |||
| (use-package hydra) | ||||
| (use-package idle-highlight-mode :hook ((prog-mode . idle-highlight-mode))) | ||||
| 
 | ||||
| (use-package ivy | ||||
|   :config | ||||
|   (ivy-mode 1)) | ||||
| 
 | ||||
| (use-package ivy-prescient | ||||
|   :after (ivy prescient) | ||||
|   :config | ||||
|   (ivy-prescient-mode) | ||||
|   ;; Fixes an issue with how regexes are passed to ripgrep from counsel, | ||||
|   ;; see raxod502/prescient.el#43 | ||||
|   (setf (alist-get 'counsel-rg ivy-re-builders-alist) #'ivy--regex-plus)) | ||||
| 
 | ||||
| (use-package multiple-cursors) | ||||
| 
 | ||||
| (use-package notmuch | ||||
|  | @ -79,18 +68,15 @@ | |||
|   (pinentry-start)) | ||||
| 
 | ||||
| (use-package prescient | ||||
|   :after (ivy counsel) | ||||
|   :config (prescient-persist-mode)) | ||||
|   :config | ||||
|   (prescient-persist-mode) | ||||
|   (setq completion-styles '(basic prescient))) | ||||
| 
 | ||||
| (use-package rainbow-delimiters :hook (prog-mode . rainbow-delimiters-mode)) | ||||
| (use-package rainbow-mode) | ||||
| (use-package s) | ||||
| (use-package string-edit-at-point) | ||||
| 
 | ||||
| (use-package swiper | ||||
|   :after (counsel ivy) | ||||
|   :bind (("C-s" . swiper))) | ||||
| 
 | ||||
| (use-package telephone-line) ;; configuration happens outside of use-package | ||||
| (use-package term-switcher) | ||||
| 
 | ||||
|  | @ -205,6 +191,10 @@ | |||
| 
 | ||||
| (use-package tvl) | ||||
| 
 | ||||
| (use-package vertico | ||||
|   :config | ||||
|   (vertico-mode)) | ||||
| 
 | ||||
| (use-package web-mode) | ||||
| (use-package yaml-mode) | ||||
| (use-package zoxide) | ||||
|  |  | |||
|  | @ -1,8 +1,6 @@ | |||
| (require 'notmuch) | ||||
| (require 'counsel-notmuch) | ||||
| 
 | ||||
| ;; (global-set-key (kbd "C-c m") 'notmuch-hello) | ||||
| ;; (global-set-key (kbd "C-c C-m") 'counsel-notmuch) | ||||
| ;; (global-set-key (kbd "C-c C-e n") 'notmuch-mua-new-mail) | ||||
| 
 | ||||
| (setq notmuch-cache-dir (format "%s/.cache/notmuch" (getenv "HOME"))) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue