diff --git a/lisp/init-corfu.el b/lisp/init-corfu.el index f5f121df47..7c4a44b82e 100644 --- a/lisp/init-corfu.el +++ b/lisp/init-corfu.el @@ -81,17 +81,19 @@ ;; Add extensions (use-package cape ;; Bind dedicated completion commands + ;; Alternative prefix keys: C-c p, M-p, M-+, ... :bind (("C-c p p" . completion-at-point) ;; capf ("C-c p t" . complete-tag) ;; etags ("C-c p d" . cape-dabbrev) ;; or dabbrev-completion ("C-c p h" . cape-history) ("C-c p f" . cape-file) ("C-c p k" . cape-keyword) - ("C-c p s" . cape-symbol) + ("C-c p s" . cape-elisp-symbol) + ("C-c p e" . cape-elisp-block) ("C-c p a" . cape-abbrev) - ("C-c p i" . cape-ispell) ("C-c p l" . cape-line) ("C-c p w" . cape-dict) + ("C-c p :" . cape-emoji) ("C-c p \\" . cape-tex) ("C-c p _" . cape-tex) ("C-c p ^" . cape-tex) @@ -99,12 +101,23 @@ ("C-c p r" . cape-rfc1345)) :init (setq cape-dabbrev-min-length 3) - ;; Add `completion-at-point-functions', used by `completion-at-point'. + ;; Add to the global default value of `completion-at-point-functions' which is + ;; used by `completion-at-point'. The order of the functions matters, the + ;; first function returning a result wins. Note that the list of buffer-local + ;; completion functions takes precedence over the global list. + (add-to-list 'completion-at-point-functions #'cape-dabbrev) (add-to-list 'completion-at-point-functions #'cape-file) + (add-to-list 'completion-at-point-functions #'cape-elisp-block) + (add-to-list 'completion-at-point-functions #'cape-history) + (add-to-list 'completion-at-point-functions #'cape-keyword) (add-to-list 'completion-at-point-functions #'cape-tex) - (add-to-list 'completion-at-point-functions #'cape-dabbrev) - (setq cape-dabbrev-check-other-buffers nil) - (add-to-list 'completion-at-point-functions #'cape-keyword)) + (add-to-list 'completion-at-point-functions #'cape-sgml) + (add-to-list 'completion-at-point-functions #'cape-rfc1345) + (add-to-list 'completion-at-point-functions #'cape-abbrev) + (add-to-list 'completion-at-point-functions #'cape-dict) + (add-to-list 'completion-at-point-functions #'cape-elisp-symbol) + (add-to-list 'completion-at-point-functions #'cape-line) + (setq cape-dabbrev-check-other-buffers nil)) (use-package corfu-english-helper :ensure nil