From 5d1066f6edcc09f7c48938f5b568fe5d497adfab Mon Sep 17 00:00:00 2001 From: Tim McCarthy Date: Sun, 9 Oct 2022 22:59:55 -0700 Subject: [PATCH] Add corfu to Emacs config --- thoom-emacs/ThoomEmacs.org | 33 ++++++++++++++++++++++++++++++++- thoom-emacs/init.el | 30 ++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/thoom-emacs/ThoomEmacs.org b/thoom-emacs/ThoomEmacs.org index f7c2186..ef0f505 100644 --- a/thoom-emacs/ThoomEmacs.org +++ b/thoom-emacs/ThoomEmacs.org @@ -354,7 +354,38 @@ When in indent-rigidly mode (=+= in normal state), use =H/L= to adjust indent by (meow-global-mode 1)) #+end_src -** TODO Autocompletion +** Autocompletion +#+begin_src emacs-lisp +(use-package corfu + :straight t + ;; Optional customizations + ;; :custom + ;; (corfu-cycle t) ;; Enable cycling for `corfu-next/previous' + ;; (corfu-auto t) ;; Enable auto completion + ;; (corfu-separator ?\s) ;; Orderless field separator + ;; (corfu-quit-at-boundary nil) ;; Never quit at completion boundary + ;; (corfu-quit-no-match nil) ;; Never quit, even if there is no match + ;; (corfu-preview-current nil) ;; Disable current candidate preview + ;; (corfu-preselect-first nil) ;; Disable candidate preselection + ;; (corfu-on-exact-match nil) ;; Configure handling of exact matches + ;; (corfu-echo-documentation nil) ;; Disable documentation in the echo area + ;; (corfu-scroll-margin 5) ;; Use scroll margin + + ;; Enable Corfu only for certain modes. + ;; :hook ((prog-mode . corfu-mode) + ;; (shell-mode . corfu-mode) + ;; (eshell-mode . corfu-mode)) + + ;; Recommended: Enable Corfu globally. + ;; This is recommended since Dabbrev can be used globally (M-/). + ;; See also `corfu-excluded-modes'. + :init + (global-corfu-mode)) + +(use-package emacs + :init + (setq tab-always-indent 'complete)) +#+end_src * Org #+begin_src emacs-lisp (use-package org diff --git a/thoom-emacs/init.el b/thoom-emacs/init.el index 0f95599..3926403 100644 --- a/thoom-emacs/init.el +++ b/thoom-emacs/init.el @@ -301,6 +301,36 @@ (meow-global-mode 1)) +(use-package corfu + :straight t + ;; Optional customizations + ;; :custom + ;; (corfu-cycle t) ;; Enable cycling for `corfu-next/previous' + ;; (corfu-auto t) ;; Enable auto completion + ;; (corfu-separator ?\s) ;; Orderless field separator + ;; (corfu-quit-at-boundary nil) ;; Never quit at completion boundary + ;; (corfu-quit-no-match nil) ;; Never quit, even if there is no match + ;; (corfu-preview-current nil) ;; Disable current candidate preview + ;; (corfu-preselect-first nil) ;; Disable candidate preselection + ;; (corfu-on-exact-match nil) ;; Configure handling of exact matches + ;; (corfu-echo-documentation nil) ;; Disable documentation in the echo area + ;; (corfu-scroll-margin 5) ;; Use scroll margin + + ;; Enable Corfu only for certain modes. + ;; :hook ((prog-mode . corfu-mode) + ;; (shell-mode . corfu-mode) + ;; (eshell-mode . corfu-mode)) + + ;; Recommended: Enable Corfu globally. + ;; This is recommended since Dabbrev can be used globally (M-/). + ;; See also `corfu-excluded-modes'. + :init + (global-corfu-mode)) + +(use-package emacs + :init + (setq tab-always-indent 'complete)) + (use-package org :hook (org-mode . visual-line-mode) :config