aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d')
-rw-r--r--.emacs.d/init.el1
-rw-r--r--.emacs.d/lisp/init-company.el3
-rw-r--r--.emacs.d/lisp/init-corfu.el25
3 files changed, 28 insertions, 1 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 22c9e7f..8fad1fc 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -22,6 +22,7 @@
(require 'init-evil)
(require 'init-minibuffer)
(require 'init-company)
+(require 'init-corfu)
(require 'init-flycheck)
(require 'init-org)
(require 'init-lang)
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)