Corfu

about | blog | config | notes | github

1. Completion Overlay Region Function

corfu enhances the defeault completion in region functions with a improved and minimal completion overlay.

2. Configuration

2.1. Setup Dependencies

It is useful to incorporate Orderless.

(require 'init-orderless)

2.2. Package Install

(use-package corfu
  :straight '(corfu :host github
                    :repo "minad/corfu")
  :bind (:map corfu-map
         ("M-h" . corfu-show-documentation)
         ("M-j" . corfu-next)
         ("M-k" . corfu-previous)
         ("M-l" . corfu-quit))
  :config (corfu-global-mode))

2.3. Customizations

Enable auto completion engine automatically.

(setq corfu-auto t)

Allow cycling between entries.

(setq corfu-cycle t)

This allows me to use tab to start autocompletion.

(setq tab-always-indent 'complete)

Do not commit selected candidates on next input.

(setq corfu-commit-predicate nil)

Automatically quit at word boundary.

(setq corfu-quit-at-boundary nil)

Automatically quit if there is no match.

(setq corfu-quit-no-match t)

Show documentation in the echo area.

(setq corfu-echo-documentation t)

2.4. Feature Provide

(provide 'init-corfu)

Created: 2021-11-13

Emacs 26.1 (Org mode 9.5)