Skip to content

Commit

Permalink
feat(marginalia): Add Nerd Icons to Marginalia
Browse files Browse the repository at this point in the history
Why?:
- Provide a similar functionality to Ivy Rich for use in the minibuffer.

This change addresses the need by:
- Add new layer variable compleseus-use-nerd-icons
- Add compleseus/init-nerd-icons-completion function
  • Loading branch information
Tobias Heinlein authored and smile13241324 committed Oct 27, 2024
1 parent 8744ec9 commit 7c65dfe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions layers/+completion/compleseus/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"Options are `selectrum', and `vertico' to use as completion
engine.")

(defvar compleseus-use-nerd-icons nil
"Use nerd-icons with marginalia to provide icons in the mini-buffer")

(defvar compleseus-buffer-search-restrict-project t
"If non-nil, `spacemacs/consult-line-multi' and `spacemacs/consult-line-multi-symbol'
will be restricted to buffers of the current project.
Expand Down
10 changes: 10 additions & 0 deletions layers/+completion/compleseus/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
(helm-make :location (recipe :fetcher github
:repo "myrgy/helm-make"
:branch "add_emacs_completion"))
(nerd-icons-completion :toggle compleseus-use-nerd-icons)
orderless
persp-mode
(selectrum :toggle (eq compleseus-engine 'selectrum))
Expand Down Expand Up @@ -170,6 +171,7 @@
"hm" #'consult-man
"jm" #'consult-mark
"jM" #'consult-global-mark

"sb" #'spacemacs/consult-line-multi
"sB" #'spacemacs/consult-line-multi-symbol
"ss" #'spacemacs/consult-line
Expand Down Expand Up @@ -497,3 +499,11 @@
(setq
spacemacs--persp-display-buffers-func 'spacemacs/compleseus-switch-to-buffer
spacemacs--persp-display-perspectives-func 'spacemacs/compleseus-spacemacs-layout-layouts)))

(defun compleseus/init-nerd-icons-completion ()
(use-package nerd-icons-completion
:defer t
:after marginalia
:hook (marginalia-mode . nerd-icons-completion-marginalia-setup)
:init
(nerd-icons-completion-mode)))

0 comments on commit 7c65dfe

Please sign in to comment.