Skip to content

iyefrat/all-the-icons-completion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

all-the-icons-completion

https://melpa.org/packages/all-the-icons-completion-badge.svg

Add icons to completion candidates using the built in completion metadata functions.

This package can be used with the default completions buffer: https://user-images.githubusercontent.com/19792685/127399489-91048936-95ee-4189-acc4-f88d7bd8b1a1.png

Or with a completion framework such as Vertico: https://user-images.githubusercontent.com/19792685/127399499-00101758-3dad-4983-abd1-0c3a58927f00.png

Requirements

This package only supports Emacs version 26.1 and above.

It requires all-the-icons.

Installation

This package can be installed from MELPA, or by cloning it and putting it in the load path.

Setup

Add the following to your init-file:

(all-the-icons-completion-mode)

If you want to use it as an addon to marginalia-mode, add the following to your init-file:

(all-the-icons-completion-mode)
(add-hook 'marginalia-mode-hook #'all-the-icons-completion-marginalia-setup)

This will ensure that it is on when marginalia-mode is on and is off when it’s off.

Customization

Completion icons are retrieved through the generic function all-the-icons-completion-get-icon, with different methods per category. To add icons for a new category or override existing behaviour, define a new method, e.g.:

(cl-defmethod all-the-icons-completion-get-icon (cand (_cat (eql custom-category)))
  "Return the icon for the candidate CAND of completion category custom-category."
  (get-icon-for-custom-category-cand cand))

Acknowledgements

Thanks to @minad and @noctuid for getting the ball rolling on the functions used in this package.

About

Add icons to completion candidates in Emacs

Resources

License

Stars

Watchers

Forks

Packages

No packages published