Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add indicators nerd icons #850

Merged
merged 2 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Citar provides a highly-configurable =completing-read= front-end to browse and a
- major-mode adapters
- entry-opening, to go to the original entry data

Here's a screenshot with [[https://github.com/minad/vertico][vertico]] and symbol customization [[https://github.com/bdarcus/citar#icons][noted below]].
Here's a screenshot with [[https://github.com/minad/vertico][vertico]] and symbol customization [[https://github.com/emacs-citar/citar?tab=readme-ov-file#rich-ui][noted below]].

#+caption: vertico with citar
[[file:images/vertico.png]]
Expand Down Expand Up @@ -252,6 +252,48 @@ Here's an example indicator definition incorporating icons:

Keep in mind, however, the included predicate functions must be performance-optimized, since the completion UI runs them on your entire library every time you open it.

**** With [[https://github.com/rainstormstudio/nerd-icons.el][nerd-icons]] (for doom users too)

[[file:images/indicators-nerd-icons.png]]

Nerd-icons.el is a library for easily using Nerd Font icons inside Emacs, an alternative to all-the-icons, and it is the icon package that already included in [[https://github.com/doomemacs/doomemacs][Doom Emacs]]. Here's an example of getting a similar look with it:

#+begin_src emacs-lisp
(defvar citar-indicator-notes-icons
(citar-indicator-create
:symbol (nerd-icons-mdicon
"nf-md-notebook"
:face 'nerd-icons-blue
:v-adjust -0.3)
:function #'citar-has-notes
:padding " "
:tag "has:notes"))

(defvar citar-indicator-links-icons
(citar-indicator-create
:symbol (nerd-icons-octicon
"nf-oct-link"
:face 'nerd-icons-orange
:v-adjust -0.1)
:function #'citar-has-links
:padding " "
:tag "has:links"))

(defvar citar-indicator-files-icons
(citar-indicator-create
:symbol (nerd-icons-faicon
"nf-fa-file"
:face 'nerd-icons-green
:v-adjust -0.1)
:function #'citar-has-files
:padding " "
:tag "has:files"))

(setq citar-indicators
(list citar-indicator-files-icons
citar-indicator-notes-icons
citar-indicator-links-icons))
#+end_src
** Test Script
:PROPERTIES:
:CUSTOM_ID: test-script
Expand Down
Binary file added images/indicators-nerd-icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.