Repolode
minad

minad/corfu

Corfu is a minimalist in-buffer completion popup for Emacs that reuses Emacs' built-in completion-at-point facilities.

Open-source alternative to:Company

Stars
1,555
Forks
59
Open issues
0
Last commit
6 days ago

What is it?

Corfu shows completion candidates in a small popup near point in Emacs buffers, letting you move through them with the arrow keys and insert one with TAB or RET. It is the in-buffer counterpart of the Vertico minibuffer UI and is built on the standard completion-at-point (Capf) and completion-in-region interfaces rather than its own backend API.

Corfu does not ship completion backends of its own. Completions come from Emacs built-in Capfs, third-party language packages, or dabbrev, and companion packages such as Cape supply additional sources. Auto-completion is off by default and can be enabled with corfu-auto. Optional extensions add candidate documentation in the echo area or a popup, history-based sorting, quick keys, and mouse support.

Corfu works with Orderless and other completion styles, and it can be used in the minibuffer and in Eshell or shell buffers. On Emacs 31 it runs in terminal Emacs; older versions need the separate corfu-terminal package.

Key features

  • 01Popup shows candidates below or above point, navigable with arrow keys.
  • 02Auto-completion triggered by a timer or trigger characters, off by default.
  • 03Candidate preview and annotations via annotation and affixation functions.
  • 04Sorting by prefix, length, alphabetical order, or history.
  • 05Orderless completion style support with configurable separators.
  • 06Optional extensions for echo-area docs, popup docs, quick keys, and history.

Use cases

  • Getting in-buffer completions while editing code in Emacs.
  • Completing commands and paths in Eshell or shell buffers.
  • Using dabbrev or Capf sources for word completion while writing text.
  • Combining fast prefix filtering with Orderless for advanced matching.

Quick start

  1. 1

    Install Corfu from ELPA or MELPA

    M-x package-install RET corfu RET
  2. 2

    Activate the global minor mode

    M-x global-corfu-mode RET
  3. 3

    Press M-TAB (or TAB) in a buffer to complete

Things to know

  • On Emacs versions before 31, the popup needs child frames, so terminal Emacs requires the separate corfu-terminal package.
  • Auto completion is off by default and can run untrusted code in some completion functions, so it should be used carefully.

Topics

#emacs#completion#editor#elisp#in-buffer-completion#autocomplete

FAQ

What is corfu?
Corfu is a minimalist in-buffer completion popup for Emacs that reuses Emacs' built-in completion-at-point facilities. Corfu shows completion candidates in a small popup near point in Emacs buffers, letting you move through them with the arrow keys and insert one with TAB or RET. It is the in-buffer counterpart of the Vertico minibuffer UI and is built on the standard completion-at-point (Capf) and completion-in-region interfaces rather than its own backend API.
Is corfu free to use? What license does it have?
corfu is open source under the GPL-3.0 license. Check the license terms before using it in commercial products.
Is corfu still maintained?
Actively maintained. The last commit to corfu was on Nov 1, 2026.
What can I use corfu for?
Getting in-buffer completions while editing code in Emacs. Completing commands and paths in Eshell or shell buffers. Using dabbrev or Capf sources for word completion while writing text. Combining fast prefix filtering with Orderless for advanced matching.
How do I install corfu?
Install Corfu from ELPA or MELPA: M-x package-install RET corfu RET Activate the global minor mode: M-x global-corfu-mode RET Press M-TAB (or TAB) in a buffer to complete
Where can I get corfu?
The source code and installation instructions are on GitHub: https://github.com/minad/corfu

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects