aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d/lisp/init-corfu.el
blob: 7b5899d8b4c324377751a2f9be9d8b010276ff49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
;; -*- lexical-binding: t; -*-

(when (gx/maybe-require-package 'corfu)
  (autoload 'corfu-mode "corfu")
  (when (display-graphic-p)
    (add-hook 'ledger-mode-hook #'corfu-mode)
    (add-hook 'prog-mode-hook #'corfu-mode)))

(setq corfu-cycle t
      corfu-auto t
      corfu-quit-no-match t
      corfu-preselect-first nil
      corfu-auto-prefix 1
      corfu-auto-delay 0.01)

(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))

(provide 'init-corfu)