summaryrefslogtreecommitdiff
path: root/emacs/custom/my-completion.el
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-09-17 18:05:15 -0700
committerFranck Cuny <franck@fcuny.net>2022-09-17 19:36:58 -0700
commit87f4197f234ef838843f0df175d0c5834e58b76e (patch)
treeccad1db45f13fb493c175b11becee8d6f0d881a3 /emacs/custom/my-completion.el
parentfeat(lang/nix): configure Emacs for nix (diff)
downloademacs.d-87f4197f234ef838843f0df175d0c5834e58b76e.tar.gz
ref(completion): add more packages for completion
Get LSP to work with cape and corfu for the completion. Change-Id: Id8f01b1dee77957ff5ba27ed471707b7b9c7dc93
Diffstat (limited to 'emacs/custom/my-completion.el')
-rw-r--r--emacs/custom/my-completion.el22
1 files changed, 16 insertions, 6 deletions
diff --git a/emacs/custom/my-completion.el b/emacs/custom/my-completion.el
index 818355b..ecc5adb 100644
--- a/emacs/custom/my-completion.el
+++ b/emacs/custom/my-completion.el
@@ -9,6 +9,11 @@
(require 'marginalia)
(require 'corfu)
(require 'consult)
+(require 'savehist)
+(require 'cape)
+(require 'tempel)
+
+(savehist-mode t)
(setq vertico-multiform-categories
'((consult-grep buffer)))
@@ -22,13 +27,18 @@
(setq completion-styles '(orderless basic))
(setq completion-category-defaults nil)
-(setq corfu-cycle t) ;; Enable cycling for `corfu-next/previous'
-(setq corfu-auto t) ;; Enable auto completion
+(setq corfu-cycle t) ;; Enable cycling for `corfu-next/previous'
+(setq corfu-auto t) ;; Enable auto completion
+(setq corfu-max-width 80) ;; Default is 100 and is too wide
+
+(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)
-(vertico-multiform-mode 1)
-(marginalia-mode)
-(global-corfu-mode)
+(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)
(global-set-key (kbd "C-c m") 'consult-mode-command)
(global-set-key (kbd "C-x b") 'consult-buffer)