Skip to content

Commit 2826996

Browse files
larrasketbdarcus
authored andcommitted
docs: dd example of UI indicators with nerd-icons.el
1 parent 244b1a5 commit 2826996

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

README.org

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,48 @@ Here's an example indicator definition incorporating icons:
252252

253253
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.
254254

255+
**** With [[https://github.com/rainstormstudio/nerd-icons.el][nerd-icons]] (for doom users too)
256+
257+
[[file:images/indicators-nerd-icons.png]]
258+
259+
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:
260+
261+
#+begin_src emacs-lisp
262+
(defvar citar-indicator-notes-icons
263+
(citar-indicator-create
264+
:symbol (nerd-icons-mdicon
265+
"nf-md-notebook"
266+
:face 'nerd-icons-blue
267+
:v-adjust -0.3)
268+
:function #'citar-has-notes
269+
:padding " "
270+
:tag "has:notes"))
271+
272+
(defvar citar-indicator-links-icons
273+
(citar-indicator-create
274+
:symbol (nerd-icons-octicon
275+
"nf-oct-link"
276+
:face 'nerd-icons-orange
277+
:v-adjust -0.1)
278+
:function #'citar-has-links
279+
:padding " "
280+
:tag "has:links"))
281+
282+
(defvar citar-indicator-files-icons
283+
(citar-indicator-create
284+
:symbol (nerd-icons-faicon
285+
"nf-fa-file"
286+
:face 'nerd-icons-green
287+
:v-adjust -0.1)
288+
:function #'citar-has-files
289+
:padding " "
290+
:tag "has:files"))
291+
292+
(setq citar-indicators
293+
(list citar-indicator-files-icons
294+
citar-indicator-notes-icons
295+
citar-indicator-links-icons))
296+
#+end_src
255297
** Test Script
256298
:PROPERTIES:
257299
:CUSTOM_ID: test-script

images/indicators-nerd-icons.png

115 KB
Loading

0 commit comments

Comments
 (0)