diff options
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/custom/my-completion.el | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/emacs/custom/my-completion.el b/emacs/custom/my-completion.el index 1c2ef98..a8629c8 100644 --- a/emacs/custom/my-completion.el +++ b/emacs/custom/my-completion.el @@ -4,26 +4,19 @@ ;;; Code: -(require 'vertico) -(require 'vertico-multiform) -(require 'marginalia) +(require 'cape) +(require 'consult) (require 'corfu) (require 'corfu-doc) -(require 'consult) +(require 'orderless) +(require 'marginalia) (require 'savehist) -(require 'cape) -(require 'tempel) +(require 'vertico) +;;; settings +;; save the mini buffer's history (savehist-mode t) - -(setq vertico-multiform-categories - '((consult-grep buffer))) - -(setq vertico-multiform-commands - '((consult-imenu buffer) - (consult-ripgrep buffer) - (consult-org-heading buffer ) - (consult-outline buffer))) +(setq savehist-file (expand-file-name "var/history" user-emacs-directory)) (setq completion-styles '(orderless basic)) (setq completion-category-defaults nil) @@ -32,17 +25,15 @@ (setq corfu-auto t) ;; Enable auto completion (setq corfu-max-width 80) ;; Default is 100 and is too wide -(add-hook 'corfu-mode-hook #'corfu-doc-mode) - -(vertico-mode t) ;; Enable vertico globally -(vertico-multiform-mode t) ;; Enable vertico globally -(marginalia-mode t) ;; Enable marginalia globally -(global-corfu-mode) ;; Enable corfu globally +(vertico-mode t) ;; Enable vertico globally +(marginalia-mode t) ;; Enable marginalia globally +(global-corfu-mode) ;; Enable corfu globally (add-to-list 'completion-at-point-functions #'cape-file) (add-to-list 'completion-at-point-functions #'cape-abbrev) (add-to-list 'completion-at-point-functions #'cape-ispell) +;;; bindings (global-set-key (kbd "C-c m") 'consult-mode-command) (global-set-key (kbd "C-x b") 'consult-buffer) (global-set-key (kbd "C-x 4 b") 'consult-buffer-other-window) @@ -63,6 +54,11 @@ (global-set-key (kbd "M-s l") 'consult-line) (global-set-key (kbd "M-s L") 'consult-line-multi) +;;; hooks +;; display a documentation popup for completion candidate when using +;; corfu +(add-hook 'corfu-mode-hook #'corfu-doc-mode) + (provide 'my-completion) ;;; my-completion.el ends here |