diff options
Diffstat (limited to '.emacs.d/lisp')
-rw-r--r-- | .emacs.d/lisp/init-company.el | 3 | ||||
-rw-r--r-- | .emacs.d/lisp/init-corfu.el | 25 |
2 files changed, 27 insertions, 1 deletions
diff --git a/.emacs.d/lisp/init-company.el b/.emacs.d/lisp/init-company.el index 58e4de4..12e409e 100644 --- a/.emacs.d/lisp/init-company.el +++ b/.emacs.d/lisp/init-company.el @@ -1,5 +1,6 @@ (when (gx/maybe-require-package 'company) - (add-hook 'after-init-hook 'global-company-mode)) + (when (not (display-graphic-p)) + (add-hook 'after-init-hook 'global-company-mode))) (with-eval-after-load 'company (company-tng-configure-default) diff --git a/.emacs.d/lisp/init-corfu.el b/.emacs.d/lisp/init-corfu.el new file mode 100644 index 0000000..fb92857 --- /dev/null +++ b/.emacs.d/lisp/init-corfu.el @@ -0,0 +1,25 @@ +;; -*- lexical-binding: t; -*- + +(when (gx/maybe-require-package 'corfu) + (autoload 'corfu-mode "corfu") + (when (display-graphic-p) + (add-hook 'prog-mode-hook #'corfu-mode))) + +(setq corfu-cycle t + corfu-auto t + corfu-quit-no-match t + corfu-preselect-first nil) + +(with-eval-after-load 'corfu + (define-key corfu-map (kbd "TAB") 'corfu-next) + (define-key corfu-map (kbd "<tab>") 'corfu-next) + (define-key corfu-map (kbd "S-TAB") 'corfu-previous) + (define-key corfu-map (kbd "<backtab>") 'corfu-previous)) + +(when (gx/maybe-require-package 'orderless) + (setq completion-styles '(orderless) + completion-category-defaults nil + completion-category-overrides + '((file (styles . (partial-completion)))))) + +(provide 'init-corfu) |