Skip to content

Prelude Vertico

Overview

Vertico is a minimalistic vertical completion UI for Emacs. This module sets up Vertico together with complementary packages for a modern and lightweight completion experience.

Note

This module is an alternative to the Helm, Ido, Ivy modules - you should only enable one completion framework.

Packages

  • vertico - the vertical completion UI
  • orderless - flexible completion style (space-separated patterns)
  • marginalia - rich annotations in the minibuffer (docstrings, file sizes, etc.)
  • consult - enhanced versions of built-in commands
  • embark - a keyboard-driven context menu for candidates and things at point
  • embark-consult - integration between Embark and Consult

Consult Key Bindings

Consult provides many enhanced commands. Here are the key bindings configured by Prelude:

Buffer and File Navigation

Key Command Description
C-x b consult-buffer Enhanced buffer switching
C-x 4 b consult-buffer-other-window Buffer in other window
C-x 5 b consult-buffer-other-frame Buffer in other frame
M-y consult-yank-pop Browse kill ring
Key Command Description
M-g g consult-goto-line Go to line
M-g o consult-outline Navigate outline headings
M-g m consult-mark Navigate marks
M-g k consult-global-mark Navigate global marks
M-g i consult-imenu Navigate imenu
M-g I consult-imenu-multi Navigate imenu across buffers
M-g e consult-compile-error Navigate compilation errors
M-g f consult-flycheck Navigate Flycheck errors

Search (M-s prefix)

Key Command Description
M-s l consult-line Search lines in buffer
M-s L consult-line-multi Search lines across buffers
M-s g consult-grep Grep
M-s G consult-git-grep Git grep
M-s r consult-ripgrep Ripgrep
M-s f consult-find Find files
M-s F consult-locate Locate files
M-s k consult-keep-lines Keep matching lines
M-s u consult-focus-lines Focus on matching lines

Registers

Key Command Description
M-# consult-register-load Load register
M-' consult-register-store Store register
C-M-# consult-register Browse registers

Completion Style

The module configures the orderless completion style, which allows you to type space-separated patterns that can match in any order. For example, typing buf swi would match switch-to-buffer.

Acting on Candidates with Embark

Embark is a keyboard-driven context menu. Point it at a minibuffer candidate or a thing at point (a file, a URL, a symbol, ...) and it offers the actions that make sense for it.

Key Command Description
C-. embark-act Act on the thing at point or candidate
C-; embark-dwim Run the default action directly
C-h B embark-bindings Browse the bindings at point

A particularly handy trick is embark-export: from a consult-ripgrep (or consult-line, etc.) session you can export the whole candidate set into a proper grep/occur buffer, which you can then edit in place with wgrep.

Note

C-. and C-; are also bound by flyspell-mode (auto-correct), so in buffers where Prelude enables Flyspell those keys keep their Flyspell meaning. Embark still works everywhere else, including the minibuffer, which is where you'll use it most with Vertico and Consult. Switch to the jinx spell checker (see prelude-spell-checker), or rebind the keys, if you'd rather have Embark at point in prose buffers too.