From c27c133f0ffd7af2b43b053fc83ae6aa4a18f7b9 Mon Sep 17 00:00:00 2001 From: Jessie Hildebrandt Date: Tue, 7 Jun 2022 20:28:22 -0400 Subject: [PATCH] Replace company autocompletion package with corfu --- init.el | 62 +++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/init.el b/init.el index ea6e3a1..f0b127c 100644 --- a/init.el +++ b/init.el @@ -647,32 +647,56 @@ (flycheck-mode-hook . flycheck-package-setup)) ;;==================== -;; Company (Autocompletion) +;; Corfu (Autocompletion) ;;==================== -;; Load Company -(use-package company - :defer - 2 - :config - (global-company-mode) +;; Load Corfu +(use-package corfu + :demand + t :custom - (company-idle-delay 0.3) - (company-dabbrev-downcase nil)) + (corfu-auto t) + (corfu-echo-documentation nil) + (corfu-min-width 20) + (corfu-max-width 50) + :config + (global-corfu-mode t)) -;; [Lua] -;; Load Company-Lua -(use-package company-lua +;; Load Corfu-doc +(use-package corfu-doc + :demand + t :after - (company) - :hook - (lua-mode my-lua-mode-company-init)) + (corfu) + :config + (corfu-doc-mode t) + :bind + (:map corfu-map + ("M-p" . corfu-doc-scroll-down) + ("M-n" . corfu-doc-scroll-up) + ("M-d" . corfu-doc-toggle))) -;; [PHP] -;; Load Company-PHP -(use-package company-php +;; Load Corfu-terminal +(use-package corfu-terminal + :demand + t :after - (company)) + (corfu) + :config + (unless (display-graphic-p) + (corfu-terminal-mode t))) + +;; Load kind-icon (Icons for Corfu completion symbols) +(use-package kind-icon + :demand + t + :after + (corfu) + :config + (add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter) + :custom + (kind-icon-default-face 'corfu-default) + (kind-icon-use-icons nil)) ;;==================== ;; yasnippet (Snippet Insertion/Completion)