From e8978f7b44d1b454d7335f37e2adb9d62834cf8c Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 14 Mar 2022 11:59:04 +0000 Subject: [PATCH] feat(projects): enable all-the-icons in minibuffer completion --- modules/projects/siren-all-the-icons.el | 17 +++++++++++++++++ straight/versions/default.el | 1 + 2 files changed, 18 insertions(+) diff --git a/modules/projects/siren-all-the-icons.el b/modules/projects/siren-all-the-icons.el index 6f83965..763327c 100644 --- a/modules/projects/siren-all-the-icons.el +++ b/modules/projects/siren-all-the-icons.el @@ -18,5 +18,22 @@ :if window-system :init (all-the-icons-ibuffer-mode 1)) +(use-package all-the-icons-completion + :after (marginalia all-the-icons) + :hook (marginalia-mode . all-the-icons-completion-marginalia-setup) + :init + (all-the-icons-completion-mode) + :config + + ;; Override default category lookup function. + (defun all-the-icons-completion-get-icon (cand cat) + "Return the icon for the candidate CAND of completion category CAT." + (cl-case cat + (file (all-the-icons-completion-get-file-icon cand)) + (project-file (all-the-icons-completion-get-file-icon cand)) + (buffer (all-the-icons-completion-get-buffer-icon cand)) + (project-buffer (all-the-icons-completion-get-buffer-icon cand)) + (t "")))) + (provide 'siren-all-the-icons) ;;; siren-all-the-icons.el ends here diff --git a/straight/versions/default.el b/straight/versions/default.el index 040bf55..fd49591 100644 --- a/straight/versions/default.el +++ b/straight/versions/default.el @@ -1,5 +1,6 @@ (("a.el" . "9ad2d18252b729174fe22ed0b2b7670c88f60c31") ("ace-window" . "0577c426a9833ab107bab46c60d1885c611b2fb9") + ("all-the-icons-completion" . "9e7d456b0934ecb568b6f05a8445e3f4ce32261f") ("all-the-icons-ibuffer" . "67a331c94af7670a89cea2cd58a1e7b11b83e8a9") ("all-the-icons.el" . "2c963ebb75f211d2f7ac3d2db5f4a9ee2f3e27da") ("anzu" . "5abb37455ea44fa401d5f4c1bdc58adb2448db67")