Commit fea75261948c

Vincent Demeester <vincent@sbr.pm>
2024-07-11 11:05:26
tools/emacs: update corfu configuration…
… and configure cape as well. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 5a6b237
Changed files (1)
tools
tools/emacs/config/config-completion.el
@@ -211,9 +211,16 @@ Use `mct-sort-sort-by-alpha-length' if no history is available."
 
 (use-package corfu
   :unless noninteractive
+  :bind (("C-<tab>" . corfu-candidate-overlay-complete-at-point))
+  :init
+  (require 'corfu-popupinfo)
+  (require 'corfu-history)
+  (require 'corfu-candidate-overlay)
   :config
   (global-corfu-mode 1)
+  (setq corfu-popupinfo-delay '(1.25 . 0.5))
   (corfu-popupinfo-mode 1)
+  (corfu-candidate-overlay-mode)
     ;; Sort by input history (no need to modify `corfu-sort-function').
   (with-eval-after-load 'savehist
     (corfu-history-mode 1)
@@ -229,6 +236,21 @@ Useful for prompts such as `eval-expression' and `shell-command'."
 
   (add-hook 'minibuffer-setup-hook #'contrib/corfu-enable-always-in-minibuffer 1))
 
+(use-package corfu-candidate-overlay
+  :after corfu
+  :bind (("C-<tab>" . corfu-candidate-overlay-complete-at-point))
+  :config
+  (corfu-candidate-overlay-mode +1))
+
+(use-package cape
+  :bind (("C-c p f" . cape-file)
+         ("C-c p /" . cape-dabbrev)
+         :map corfu-map
+         ("M-/" . cape-dabbrev)
+         ("C-x C-f" . cape-file))
+  :config
+  (add-to-list 'completion-at-point-functions #'cape-file))
+
 (use-package orderless
   :unless noninteractive
   :config