diff options
| author | Daniel <[email protected]> | 2024-04-29 14:42:58 -0400 |
|---|---|---|
| committer | Daniel <[email protected]> | 2024-04-29 14:42:58 -0400 |
| commit | 9693cd567659d4d513da7b6b9cdfaf424f5cc384 (patch) | |
| tree | d6cdf05cfad033aa6ba639cdf457a01dc69fe827 | |
| parent | 6558da01646252db3994ed76e3c54c190555645f (diff) | |
better completion with corfu
| -rw-r--r-- | bard-emacs-modules/bard-emacs-completion.el | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/bard-emacs-modules/bard-emacs-completion.el b/bard-emacs-modules/bard-emacs-completion.el index 68f72c4..1f4cb08 100644 --- a/bard-emacs-modules/bard-emacs-completion.el +++ b/bard-emacs-modules/bard-emacs-completion.el @@ -42,15 +42,51 @@ :config (setq completion-styles '(orderless basic))) -(use-package company - :init - (global-company-mode 1)) +(use-package corfu + :hook (after-init . global-corfu-mode) + ;; I also have (setq tab-always-indent 'complete) for TAB to complete + ;; when it does not need to perform an indentation change. + :bind (:map corfu-map ("<tab>" . corfu-complete)) + :config + (setq corfu-preview-current nil) + (setq corfu-min-width 20) + + (setq corfu-popupinfo-delay nil) + (corfu-popupinfo-mode 1) ; shows documentation after `corfu-popupinfo-delay' + + ;; Sort by input history (no need to modify `corfu-sort-function'). + (with-eval-after-load 'savehist + (corfu-history-mode 1) + (add-to-list 'savehist-additional-variables 'corfu-history))) + +(use-package minibuffer + :ensure nil + :config +;;;; Completion styles + (setq completion-styles '(basic substring initials flex orderless)) + + (setq completion-category-defaults nil) + + (setq completion-category-overridesd + '((file (styles . (basic partial-completion orderless))) + (bookmark (styles . (basic substring))) + (library (styles . (basic substring))) + (embark-keybinding (styles . (basic substring))) + (imenu (styles . (basic substring orderless))) + (consult-location (styles . (basic substring orderless))) + (kill-ring (styles . (emacs22 orderless))) + (eglot (styles . (emacs22 substring orderless)))))) (use-package consult :defer 2 :bind + ("M-g M-g" . consult-goto-line) ("C-x b" . consult-buffer) - ("C-z s" . consult-ripgrep)) + ("M-s M-f" . consult-find) + ("M-s M-g" . consult-grep) + ("M-s M-h" . consult-history) + ("M-s M-y" . consult-yank-pop) + ("M-s M-s" . consult-outline)) (use-package embark :ensure t @@ -73,7 +109,6 @@ (variable bard-embark-variable-map) (t embark-general-map))) - (defun bard-embark-act-no-quit () "Call `embark-act' but do not quit after the action." (interactive) |
