;;; module-consult.el --- setup consult for emacs ;;; ;;; Commentary: ;;; ;;; Setup consult for Emacs. ;;; ;;; Code: (require 'module-pkg) (pkg/require 'consult) (setq consult-preview-key nil) ;; use ripgrep (setq consult-ripgrep-command "rg --null --line-buffered --color=ansi --max-columns=1000 --no-heading --line-number . -e ARG OPTS") (setq consult-grep-command "rg --null --line-buffered --color=ansi --max-columns=1000 --no-heading --line-number . -e ARG OPTS") ;; mode-specific histories (setq consult-mode-histories '((comint-mode . comint-input-ring) (eshell-mode . eshell-history-ring) (geiser-repl-mode . geiser-repl--history) (inferior-python-mode . comint-input-ring) (minibuffer-local-map . consult-history))) (consult-customize consult-theme :preview-key '(:debounce 0.2 any) consult-ripgrep consult-git-grep consult-grep consult-bookmark consult-recent-file consult-xref consult--source-bookmark consult--source-recent-file consult--source-project-recent-file :preview-key '(:debounce 0.4 any)) ;; async search (setq consult-async-min-input 2 consult-async-refresh-delay 0.15 consult-async-input-throttle 0.2 consult-async-input-debounce 0.1) ;; select xref locations with preview (setq xref-show-xrefs-function #'consult-xref xref-show-definitions-function #'consult-xref) (global-set-key (kbd "C-s") #'consult-line) (global-set-key (kbd "C-r") #'consult-line-multi) (global-set-key (kbd "C-c h") #'consult-history) (global-set-key (kbd "C-c m") #'consult-mode-command) (global-set-key (kbd "C-c k") #'consult-kmacro) (global-set-key (kbd "C-c s") #'consult-ripgrep) (provide 'module-consult) ;;; module-consult.el ends here.