refactor!: replace all-the-icons with nerd-icons

BREAKING CHANGE: This commit replaces all-the-icons with nerd-fonts. Any
all-the-icons-* function calls or variable references in your private
config will break and should be replaced with their nerd-icons-*
equivalent. That said, Doom will continue to install all-the-icons for
a while, so feel free to load it if you don't want to fully commit to
the change yet.

This change is happening because nerd-icon has wider support for GUI and
TUI Emacs; has a larger, more consistent selection of symbols; plus unicode
coverage.

Fix: #7368
Close: #6675
Close: #7364
This commit is contained in:
Ellis Kenyő 2023-09-14 00:03:55 +01:00 committed by GitHub
parent 7bdf7cf7c0
commit 9787022b83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 293 additions and 407 deletions

View file

@ -16,7 +16,7 @@ This module provides reasonable defaults and augmentations for dired.
Enables dired to be more like [[https://github.com/ranger/ranger][ranger]].
** Packages
- [[doom-package:all-the-icons-dired]] if [[doom-module:+icons]]
- [[doom-package:nerd-icons-dired]] if [[doom-module:+icons]]
- [[doom-package:diff-hl]]
- [[doom-package:diredfl]]
- [[doom-package:dired-rsync]]
@ -43,10 +43,10 @@ This module has no requirements *except on BSDs* like MacOS or FreeBSD, where
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote
| Keybind | Description |
|---------+----------------------------|
| [[kbd:][SPC f d]] | Find directory with dired |
| [[kbd:][q]] | Exit dired buffer |
| Keybind | Description |
|-------------------+---------------------------------------------|
| [[kbd:][SPC f d]] | Find directory with dired |
| [[kbd:][q]] | Exit dired buffer |
| [[kbd:][C-c C-r]] | Run [[doom-package:dired-rsync]] |
| [[kbd:][C-c C-e]] | Rename entries with [[doom-package:wdired]] |

View file

@ -1,5 +1,8 @@
;;; tools/dired/config.el -*- lexical-binding: t; -*-
(defvar +dired-dirvish-icon-provider 'nerd-icons
"Icon provider to use for dirvish when the module is enabled.")
(use-package! dired
:commands dired-jump
:init
@ -139,7 +142,7 @@ we have to clean it up ourselves."
dirvish-attributes '(git-msg)
dired-omit-files (concat dired-omit-files "\\|^\\..*$"))
(when (modulep! +icons)
(push 'all-the-icons dirvish-attributes))
(push +dired-dirvish-icon-provider dirvish-attributes))
(map! :map dirvish-mode-map
:n "b" #'dirvish-goto-bookmark
:n "z" #'dirvish-show-history
@ -151,28 +154,20 @@ we have to clean it up ourselves."
"h" #'dired-omit-mode))
(use-package! all-the-icons-dired
(use-package! nerd-icons-dired
:when (modulep! +icons)
:unless (modulep! +dirvish)
:hook (dired-mode . all-the-icons-dired-mode)
:hook (dired-mode . nerd-icons-dired-mode)
:config
;; HACK Fixes #1929: icons break file renaming in Emacs 27+, because the icon
;; is considered part of the filename, so we disable icons while we're in
;; wdired-mode.
(defvar +wdired-icons-enabled -1)
;; display icons with colors
(setq all-the-icons-dired-monochrome nil)
(defadvice! +dired-disable-icons-in-wdired-mode-a (&rest _)
:before #'wdired-change-to-wdired-mode
(setq-local +wdired-icons-enabled (if all-the-icons-dired-mode 1 -1))
(when all-the-icons-dired-mode
(all-the-icons-dired-mode -1)))
(setq-local +wdired-icons-enabled (if nerd-icons-dired-mode 1 -1))
(when nerd-icons-dired-mode
(nerd-icons-dired-mode -1)))
(defadvice! +dired-restore-icons-after-wdired-mode-a (&rest _)
:after #'wdired-change-to-dired-mode
(all-the-icons-dired-mode +wdired-icons-enabled)))
(nerd-icons-dired-mode +wdired-icons-enabled)))
(use-package! dired-x

View file

@ -10,5 +10,5 @@
(package! dirvish :pin "4fe9c00894304e99aca22ae4b6b656fe94b8f927"))
(when (and (modulep! +icons)
(not (modulep! +dirvish)))
(package! all-the-icons-dired :pin "5e9b097f9950cc9f86de922b07903a4e5fefc733"))
(package! nerd-icons-dired :pin "b7605208215194fb97da703dff8c1a71738a6533"))
(package! fd-dired :pin "458464771bb220b6eb87ccfd4c985c436e57dc7e")