From fb32e92f9225958dabffe45860ad8ba723aaf4bc Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 13 Nov 2023 06:43:25 +0000 Subject: [PATCH] Add icons to citar --- home/emacs/init.el | 46 +++++++++++++++++++++++++++++++++++++++++++-- home/emacs/init.org | 46 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 88 insertions(+), 4 deletions(-) diff --git a/home/emacs/init.el b/home/emacs/init.el index 6212f880..873e7e6d 100644 --- a/home/emacs/init.el +++ b/home/emacs/init.el @@ -325,8 +325,50 @@ citar-symbols '((file "F" . "󰂺") (note "N" . "󰎞") (link "L" . "󰌹"))) -(when (require 'citar nil :noerror) - (keymap-global-set "C-c o c o" #'citar-open)) + +(use-package citar + :ensure t + :bind (("C-c o c o" . citar-open)) + :config + (defvar citar-indicator-files-icons + (citar-indicator-create + :symbol (nerd-icons-octicon + "nf-oct-file" + :face 'nerd-icons-green + :v-adjust -0.1) + :function #'citar-has-files + :padding " " ; need this because the default padding is too low for these icons + :tag "has:files")) + (defvar citar-indicator-links-icons + (citar-indicator-create + :symbol (nerd-icons-octicon + "nf-oct-link" + :face 'nerd-icons-orange + :v-adjust 0.01) + :function #'citar-has-links + :padding " " + :tag "has:links")) + (defvar citar-indicator-notes-icons + (citar-indicator-create + :symbol (nerd-icons-octicon + "nf-oct-note" + :face 'nerd-icons-blue + :v-adjust -0.3) + :function #'citar-has-notes + :padding " " + :tag "has:notes")) + (defvar citar-indicator-cited-icons + (citar-indicator-create + :symbol (nerd-icons-octicon + "nf-oct-circle" + :face 'nerd-icon-green) + :function #'citar-is-cited + :padding " " + :tag "is:cited")) + (setq citar-indicators (list citar-indicator-files-icons + citar-indicator-links-icons + citar-indicator-notes-icons + citar-indicator-cited-icons))) (setq khalel-import-org-file (expand-file-name "calendar.org" org-directory) khalel-import-org-file-read-only nil diff --git a/home/emacs/init.org b/home/emacs/init.org index a19893cb..510b5f41 100644 --- a/home/emacs/init.org +++ b/home/emacs/init.org @@ -381,8 +381,50 @@ For reference information, see [[https://orgmode.com][Org-mode website]] citar-symbols '((file "F" . "󰂺") (note "N" . "󰎞") (link "L" . "󰌹"))) - (when (require 'citar nil :noerror) - (keymap-global-set "C-c o c o" #'citar-open)) + + (use-package citar + :ensure t + :bind (("C-c o c o" . citar-open)) + :config + (defvar citar-indicator-files-icons + (citar-indicator-create + :symbol (nerd-icons-octicon + "nf-oct-file" + :face 'nerd-icons-green + :v-adjust -0.1) + :function #'citar-has-files + :padding " " ; need this because the default padding is too low for these icons + :tag "has:files")) + (defvar citar-indicator-links-icons + (citar-indicator-create + :symbol (nerd-icons-octicon + "nf-oct-link" + :face 'nerd-icons-orange + :v-adjust 0.01) + :function #'citar-has-links + :padding " " + :tag "has:links")) + (defvar citar-indicator-notes-icons + (citar-indicator-create + :symbol (nerd-icons-octicon + "nf-oct-note" + :face 'nerd-icons-blue + :v-adjust -0.3) + :function #'citar-has-notes + :padding " " + :tag "has:notes")) + (defvar citar-indicator-cited-icons + (citar-indicator-create + :symbol (nerd-icons-octicon + "nf-oct-circle" + :face 'nerd-icon-green) + :function #'citar-is-cited + :padding " " + :tag "is:cited")) + (setq citar-indicators (list citar-indicator-files-icons + citar-indicator-links-icons + citar-indicator-notes-icons + citar-indicator-cited-icons))) #+end_src ** Khalel