config

Personal configuration.
git clone git://code.dwrz.net/config
Log | Files | Refs

nerd-icons.el (92974B)


      1 ;;; nerd-icons.el --- Emacs Nerd Font Icons Library -*- lexical-binding: t -*-
      2 
      3 ;; Copyright (C) 2023 Hongyu Ding <rainstormstudio@yahoo.com>
      4 
      5 ;; Author: Hongyu Ding <rainstormstudio@yahoo.com>, Vincent Zhang <seagle0128@gmail.com>
      6 ;; Keywords: lisp
      7 ;; Package-Version: 20241106.1533
      8 ;; Package-Revision: a6ee08f1619b
      9 ;; Package-Requires: ((emacs "24.3"))
     10 ;; URL: https://github.com/rainstormstudio/nerd-icons.el
     11 ;; Keywords: convenient, lisp
     12 
     13 ;; This program is free software; you can redistribute it and/or modify
     14 ;; it under the terms of the GNU General Public License as published by
     15 ;; the Free Software Foundation, either version 3 of the License, or
     16 ;; (at your option) any later version.
     17 
     18 ;; This program is distributed in the hope that it will be useful,
     19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
     20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     21 ;; GNU General Public License for more details.
     22 
     23 ;; You should have received a copy of the GNU General Public License
     24 ;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
     25 
     26 ;;; Commentary:
     27 
     28 ;; This package was inspired by
     29 
     30 ;; - `all-the-icons', found at https://github.com/Alexander-Miller/treemacs/blob/master/src/extra/treemacs-all-the-icons.el
     31 ;; - `vim-devicons' for Vim, found at https://github.com/ryanoasis/vim-devicons
     32 ;; - `nvim-web-devicons' for NeoVim, found at https://github.com/nvim-tree/nvim-web-devicons
     33 
     34 ;; This package provides an interface to the Nerd Fonts
     35 
     36 ;; - `nerd-fonts', found at https://github.com/ryanoasis/nerd-fonts
     37 
     38 ;;; Code:
     39 
     40 (require 'cl-lib)
     41 
     42 (require 'nerd-icons-data)
     43 (require 'nerd-icons-faces)
     44 
     45 (declare-function set-fontset-font "src/fontset.c")
     46 
     47 (defgroup nerd-icons nil
     48   "Manage how Nerd Fonts formats icons."
     49   :prefix "nerd-icons-"
     50   :group 'appearance
     51   :group 'convenience)
     52 
     53 (defcustom nerd-icons-color-icons t
     54   "Whether or not to include a foreground color when formatting the icon."
     55   :group 'nerd-icons
     56   :type 'boolean)
     57 
     58 (defcustom nerd-icons-scale-factor 1.0
     59   "The base Scale Factor for the `height' face property of an icon."
     60   :group 'nerd-icons
     61   :type 'number)
     62 
     63 (defcustom nerd-icons-default-adjust 0.0
     64   "The default adjustment to be made to the `raise' display property of an icon."
     65   :group 'nerd-icons
     66   :type 'number)
     67 
     68 (defcustom nerd-icons--cache-limit 2048
     69   "Maximum cache size for functions cached by `nerd-icons-cache'."
     70   :group 'nerd-icons
     71   :type 'integer)
     72 
     73 (defcustom nerd-icons-font-family "Symbols Nerd Font Mono"
     74   "The Nerd Font for display icons."
     75   :group 'nerd-icons
     76   :type 'string)
     77 
     78 (defcustom nerd-icons-fonts-subdirectory nil
     79   "The subdirectory within the system fonts folder where the icons are installed."
     80   :group 'nerd-icons
     81   :type 'directory)
     82 
     83 (defvar nerd-icons-font-names '("NFM.ttf")
     84   "List of defined font file names.")
     85 
     86 (defvar nerd-icons-glyph-sets '() "List of defined icon glyph sets.")
     87 
     88 (defvar nerd-icons-extension-icon-alist
     89   '(
     90     ("fish"           nerd-icons-devicon "nf-dev-terminal"       :face nerd-icons-lpink)
     91     ("zsh"            nerd-icons-devicon "nf-dev-terminal"       :face nerd-icons-lcyan)
     92     ("sh"             nerd-icons-devicon "nf-dev-terminal"       :face nerd-icons-purple)
     93     ("bat"            nerd-icons-codicon "nf-cod-terminal_cmd"   :face nerd-icons-lsilver)
     94     ("cmd"            nerd-icons-codicon "nf-cod-terminal_cmd"   :face nerd-icons-lsilver)
     95     ;; Meta
     96     ("tags"           nerd-icons-octicon "nf-oct-tag"            :face nerd-icons-blue)
     97     ("log"            nerd-icons-octicon "nf-oct-log"            :face nerd-icons-maroon)
     98     ;; Config
     99     ("node"           nerd-icons-devicon "nf-dev-nodejs_small"   :face nerd-icons-green)
    100     ("babelrc"        nerd-icons-mdicon "nf-md-babel"            :face nerd-icons-yellow)
    101     ("bashrc"         nerd-icons-mdicon "nf-md-bash"             :face nerd-icons-dpink)
    102     ("bowerrc"        nerd-icons-devicon "nf-dev-bower"          :face nerd-icons-silver)
    103     ("cr"             nerd-icons-sucicon "nf-seti-crystal"       :face nerd-icons-yellow)
    104     ("ecr"            nerd-icons-sucicon "nf-seti-crystal"       :face nerd-icons-yellow)
    105     ("ini"            nerd-icons-codicon "nf-cod-settings"       :face nerd-icons-yellow)
    106     ("properties"     nerd-icons-codicon "nf-cod-settings"       :face nerd-icons-yellow)
    107     ("eslintignore"   nerd-icons-mdicon "nf-md-eslint"           :face nerd-icons-purple)
    108     ("eslint"         nerd-icons-mdicon "nf-md-eslint"           :face nerd-icons-lpurple)
    109     ("git"            nerd-icons-sucicon "nf-seti-git"            :face nerd-icons-lred)
    110     ("gitattributes"  nerd-icons-sucicon "nf-seti-git"            :face nerd-icons-lred)
    111     ("gitignore"      nerd-icons-sucicon "nf-seti-git"            :face nerd-icons-lred)
    112     ("gitmodules"     nerd-icons-sucicon "nf-seti-git"            :face nerd-icons-lred)
    113     ("mk"             nerd-icons-devicon "nf-dev-gnu"            :face nerd-icons-dorange)
    114     ;; ("cmake"    nerd-icons-devicon "cmake") TODO: cmake
    115     ("dockerignore"   nerd-icons-devicon "nf-dev-docker"         :face nerd-icons-dblue)
    116     ("xml"            nerd-icons-faicon "nf-fa-file_code_o"      :face nerd-icons-lorange)
    117     ("json"           nerd-icons-codicon "nf-cod-settings"       :face nerd-icons-yellow)
    118     ("jsonl"          nerd-icons-codicon "nf-cod-settings"       :face nerd-icons-yellow)
    119     ("cson"           nerd-icons-codicon "nf-cod-settings"       :face nerd-icons-yellow)
    120     ("yml"            nerd-icons-codicon "nf-cod-settings"       :face nerd-icons-dyellow)
    121     ("yaml"           nerd-icons-codicon "nf-cod-settings"       :face nerd-icons-dyellow)
    122     ("toml"           nerd-icons-codicon "nf-cod-settings"       :face nerd-icons-orange)
    123     ("conf"           nerd-icons-codicon "nf-cod-settings"       :face nerd-icons-dorange)
    124     ("editorconfig"   nerd-icons-sucicon "nf-seti-editorconfig"  :face nerd-icons-silver)
    125     ;; ?
    126     ("pkg"            nerd-icons-octicon "nf-oct-package"        :face nerd-icons-dsilver)
    127     ("rpm"            nerd-icons-octicon "nf-oct-package"        :face nerd-icons-dsilver)
    128     ("pkgbuild"       nerd-icons-octicon "nf-oct-package"        :face nerd-icons-dsilver)
    129     ("elc"            nerd-icons-octicon "nf-oct-file_binary"    :face nerd-icons-dsilver)
    130     ("eln"            nerd-icons-octicon "nf-oct-file_binary"    :face nerd-icons-dsilver)
    131     ("gz"             nerd-icons-octicon "nf-oct-file_binary"    :face nerd-icons-lmaroon)
    132     ("zip"            nerd-icons-octicon "nf-oct-file_zip"       :face nerd-icons-lmaroon)
    133     ("7z"             nerd-icons-octicon "nf-oct-file_zip"       :face nerd-icons-lmaroon)
    134     ("zst"            nerd-icons-octicon "nf-oct-file_zip"       :face nerd-icons-lmaroon)
    135     ("dat"            nerd-icons-faicon "nf-fa-bar_chart"        :face nerd-icons-cyan)
    136     ("dmg"            nerd-icons-octicon "nf-oct-tools"          :face nerd-icons-lsilver)
    137     ("dll"            nerd-icons-faicon "nf-fa-cogs"             :face nerd-icons-silver)
    138     ("ds_store"       nerd-icons-faicon "nf-fa-cogs"             :face nerd-icons-silver)
    139     ("exe"            nerd-icons-octicon "nf-oct-file_binary"    :face nerd-icons-dsilver)
    140     ("msg"            nerd-icons-octicon "nf-oct-mail"           :face nerd-icons-dsilver)
    141     ;; Source Codes
    142     ("ada"            nerd-icons-sucicon "nf-custom-ada"         :face nerd-icons-blue)
    143     ("adb"            nerd-icons-sucicon "nf-custom-ada"         :face nerd-icons-blue)
    144     ("adc"            nerd-icons-sucicon "nf-custom-ada"         :face nerd-icons-blue)
    145     ("ads"            nerd-icons-sucicon "nf-custom-ada"         :face nerd-icons-blue)
    146     ("gpr"            nerd-icons-sucicon "nf-custom-ada"         :face nerd-icons-green)
    147     ("cgpr"           nerd-icons-sucicon "nf-custom-ada"         :face nerd-icons-green)
    148     ("scpt"           nerd-icons-devicon "nf-dev-apple"          :face nerd-icons-pink)
    149     ;; ("aup"         nerd-icons-fileicon "audacity") TODO: audacity
    150     ("elm"            nerd-icons-sucicon "nf-seti-elm"           :face nerd-icons-blue)
    151     ("erl"            nerd-icons-devicon "nf-dev-erlang"         :face nerd-icons-red)
    152     ("hrl"            nerd-icons-devicon "nf-dev-erlang"         :face nerd-icons-dred)
    153     ("eex"            nerd-icons-sucicon "nf-seti-elixir"        :face nerd-icons-lorange)
    154     ("leex"           nerd-icons-sucicon "nf-seti-elixir"        :face nerd-icons-lorange)
    155     ("heex"           nerd-icons-sucicon "nf-seti-elixir"        :face nerd-icons-lorange)
    156     ("ex"             nerd-icons-sucicon "nf-seti-elixir"        :face nerd-icons-lpurple)
    157     ("exs"            nerd-icons-sucicon "nf-seti-elixir"        :face nerd-icons-lred)
    158     ("livemd"         nerd-icons-sucicon "nf-seti-elixir"        :face nerd-icons-lblue)
    159     ("java"           nerd-icons-devicon "nf-dev-java"           :face nerd-icons-purple)
    160     ("groovy"         nerd-icons-devicon "nf-dev-groovy"         :face nerd-icons-cyan)
    161     ("gradle"         nerd-icons-sucicon "nf-seti-gradle"        :face nerd-icons-silver)
    162     ("ebuild"         nerd-icons-mdicon "nf-md-gentoo"           :face nerd-icons-cyan)
    163     ("eclass"         nerd-icons-mdicon "nf-md-gentoo"           :face nerd-icons-blue)
    164     ("go"             nerd-icons-devicon "nf-dev-go"             :face nerd-icons-blue)
    165     ("jl"             nerd-icons-sucicon "nf-seti-julia"         :face nerd-icons-purple)
    166     ("magik"          nerd-icons-faicon "nf-fa-magic"            :face nerd-icons-blue)
    167     ;; ("matlab"      nerd-icons-devicon "matlab") TODO: matlab
    168     ("nix"            nerd-icons-mdicon "nf-md-nix"              :face nerd-icons-blue)
    169     ("pl"             nerd-icons-sucicon "nf-seti-perl"          :face nerd-icons-lorange)
    170     ("pm"             nerd-icons-sucicon "nf-seti-perl"          :face nerd-icons-lorange)
    171     ;; ("pl6"         nerd-icons-devicon"raku") TODO: raku
    172     ;; ("pm6"         nerd-icons-devicon "raku") TODO: raku
    173     ("pod"            nerd-icons-devicon "nf-dev-perl"           :face nerd-icons-lgreen)
    174     ("php"            nerd-icons-devicon "nf-dev-php"            :face nerd-icons-lsilver)
    175     ;; ("pony"        nerd-icons-devicon "pony") TODO: pony
    176     ("ps1"            nerd-icons-mdicon "nf-md-powershell"       :face nerd-icons-blue)
    177     ("pro"            nerd-icons-sucicon "nf-seti-prolog"        :face nerd-icons-lmaroon)
    178     ("proog"          nerd-icons-sucicon "nf-seti-prolog"        :face nerd-icons-lmaroon)
    179     ("py"             nerd-icons-devicon "nf-dev-python"         :face nerd-icons-dblue)
    180     ;; ("idr"         nerd-icons-devicon "idris") TODO: idris
    181     ;; ("ipynb"       nerd-icons-devicon "jupyter") TODO: jupyter
    182     ("gem"            nerd-icons-devicon "nf-dev-ruby"           :face nerd-icons-red)
    183     ;; ("raku"        nerd-icons-devicon "raku") TODO: raku
    184     ;; ("rakumod"     nerd-icons-devicon "raku") TODO: raku
    185     ("rb"             nerd-icons-octicon "nf-oct-ruby"           :face nerd-icons-lred)
    186     ("rs"             nerd-icons-devicon "nf-dev-rust"           :face nerd-icons-maroon)
    187     ("rlib"           nerd-icons-devicon "nf-dev-rust"           :face nerd-icons-dmaroon)
    188     ("r"              nerd-icons-sucicon "nf-seti-r"             :face nerd-icons-lblue)
    189     ("rd"             nerd-icons-sucicon "nf-seti-r"             :face nerd-icons-lblue)
    190     ("rdx"            nerd-icons-sucicon "nf-seti-r"             :face nerd-icons-lblue)
    191     ("rsx"            nerd-icons-sucicon "nf-seti-r"             :face nerd-icons-lblue)
    192     ("svelte"         nerd-icons-sucicon "nf-seti-svelte"        :face nerd-icons-red)
    193     ("gql"            nerd-icons-mdicon "nf-md-graphql"          :face nerd-icons-dpink)
    194     ("graphql"        nerd-icons-mdicon "nf-md-graphql"          :face nerd-icons-dpink)
    195     ;; There seems to be a a bug with this font icon which does not
    196     ;; let you propertise it without it reverting to being a lower
    197     ;; case phi
    198     ("c"              nerd-icons-sucicon "nf-custom-c"           :face nerd-icons-blue)
    199     ("h"              nerd-icons-faicon "nf-fa-h_square"         :face nerd-icons-purple)
    200     ("m"              nerd-icons-devicon "nf-dev-apple" )
    201     ("mm"             nerd-icons-devicon "nf-dev-apple" )
    202     ;;
    203     ("cc"             nerd-icons-sucicon "nf-custom-cpp"         :face nerd-icons-blue)
    204     ("cpp"            nerd-icons-sucicon "nf-custom-cpp"         :face nerd-icons-blue)
    205     ("cxx"            nerd-icons-sucicon "nf-custom-cpp"         :face nerd-icons-blue)
    206     ("hh"             nerd-icons-sucicon "nf-custom-cpp"         :face nerd-icons-purple)
    207     ("hpp"            nerd-icons-sucicon "nf-custom-cpp"         :face nerd-icons-purple)
    208     ("hxx"            nerd-icons-sucicon "nf-custom-cpp"         :face nerd-icons-purple)
    209     ;; Lisps
    210     ("cl"             nerd-icons-sucicon "nf-custom-common_lisp" :face nerd-icons-lorange)
    211     ("l"              nerd-icons-sucicon "nf-custom-scheme"      :face nerd-icons-orange)
    212     ("lisp"           nerd-icons-sucicon "nf-custom-scheme"      :face nerd-icons-orange)
    213     ;; ("hy"             nerd-icons-sucicon "nf-custom-hy"          :face nerd-icons-blue)
    214     ("el"             nerd-icons-sucicon "nf-custom-emacs"       :face nerd-icons-purple)
    215     ("clj"            nerd-icons-devicon "nf-dev-clojure"        :face nerd-icons-blue)
    216     ("cljc"           nerd-icons-devicon "nf-dev-clojure"        :face nerd-icons-blue)
    217     ("cljd"           nerd-icons-devicon "nf-dev-clojure"        :face nerd-icons-green)
    218     ("cljs"           nerd-icons-devicon "nf-dev-clojure"        :face nerd-icons-lyellow)
    219     ("coffee"         nerd-icons-devicon "nf-dev-coffeescript"   :face nerd-icons-maroon)
    220     ("iced"           nerd-icons-devicon "nf-dev-coffeescript"   :face nerd-icons-lmaroon)
    221     ("dart"           nerd-icons-devicon "nf-dev-dart"           :face nerd-icons-blue)
    222     ("ledger"         nerd-icons-mdicon  "nf-md-file_table_box_multiple" :face nerd-icons-green)
    223     ("rkt"            nerd-icons-sucicon "nf-custom-scheme"       :face nerd-icons-red)
    224     ("scrbl"          nerd-icons-sucicon "nf-custom-scheme"       :face nerd-icons-blue)
    225     ;; Stylesheeting
    226     ("css"            nerd-icons-devicon "nf-dev-css3"           :face nerd-icons-yellow)
    227     ("scss"           nerd-icons-mdicon "nf-md-sass"             :face nerd-icons-pink)
    228     ("sass"           nerd-icons-mdicon "nf-md-sass"             :face nerd-icons-dpink)
    229     ("less"           nerd-icons-devicon "nf-dev-less"           :face nerd-icons-dyellow)
    230     ;; ("postcss"     nerd-icons-devicon "postcss") TODO: postcss
    231     ;; ("sss"         nerd-icons-devicon "postcss") TODO: postcss
    232     ("styl"           nerd-icons-devicon "nf-dev-stylus"         :face nerd-icons-lgreen)
    233     ("csv"            nerd-icons-octicon "nf-oct-graph"          :face nerd-icons-dblue)
    234     ;; haskell
    235     ("hs"             nerd-icons-devicon "nf-dev-haskell"        :face nerd-icons-red)
    236     ("chs"            nerd-icons-devicon "nf-dev-haskell"        :face nerd-icons-red)
    237     ("lhs"            nerd-icons-devicon "nf-dev-haskell"        :face nerd-icons-red)
    238     ("hsc"            nerd-icons-devicon "nf-dev-haskell"        :face nerd-icons-red)
    239     ;; Web modes
    240     ("inky-haml"      nerd-icons-sucicon "nf-seti-haml"          :face nerd-icons-lyellow)
    241     ("haml"           nerd-icons-sucicon "nf-seti-haml"          :face nerd-icons-lyellow)
    242     ("htm"            nerd-icons-devicon "nf-dev-html5"          :face nerd-icons-orange)
    243     ("html"           nerd-icons-devicon "nf-dev-html5"          :face nerd-icons-orange)
    244     ("inky-er"        nerd-icons-devicon "nf-dev-html5"          :face nerd-icons-lred)
    245     ("inky-erb"       nerd-icons-devicon "nf-dev-html5"          :face nerd-icons-lred)
    246     ("erb"            nerd-icons-devicon "nf-dev-html5"          :face nerd-icons-lred)
    247     ;; ("hbs"         nerd-icons-fileicon "moustache") TODO: moustache
    248     ("inky-slim"      nerd-icons-codicon "nf-cod-dashboard"      :face nerd-icons-yellow)
    249     ("slim"           nerd-icons-codicon "nf-cod-dashboard"      :face nerd-icons-yellow)
    250     ("jade"           nerd-icons-sucicon "nf-seti-jade"          :face nerd-icons-red)
    251     ("pug"            nerd-icons-sucicon "nf-seti-pug"           :face nerd-icons-red)
    252     ;; Javascript
    253     ;; ("d3js"        nerd-icons-devicon "d3") TODO: d3
    254     ("re"             nerd-icons-sucicon "nf-seti-reasonml"      :face nerd-icons-red-alt)
    255     ("rei"            nerd-icons-sucicon "nf-seti-reasonml"      :face nerd-icons-dred)
    256     ("ml"             nerd-icons-sucicon "nf-seti-ocaml"         :face nerd-icons-lpink)
    257     ("mli"            nerd-icons-sucicon "nf-seti-ocaml"         :face nerd-icons-dpink)
    258     ("react"          nerd-icons-devicon "nf-dev-react"          :face nerd-icons-lblue)
    259     ("ts"             nerd-icons-sucicon "nf-seti-typescript"    :face nerd-icons-blue-alt)
    260     ("js"             nerd-icons-devicon "nf-dev-javascript"     :face nerd-icons-yellow)
    261     ("es"             nerd-icons-devicon "nf-dev-javascript"     :face nerd-icons-yellow)
    262     ("jsx"            nerd-icons-devicon "nf-dev-javascript"     :face nerd-icons-cyan-alt)
    263     ("tsx"            nerd-icons-sucicon "nf-seti-typescript"    :face nerd-icons-blue-alt)
    264     ("njs"            nerd-icons-mdicon "nf-md-nodejs"           :face nerd-icons-lgreen)
    265     ("vue"            nerd-icons-sucicon "nf-seti-vue"           :face nerd-icons-lgreen)
    266 
    267     ("sbt"            nerd-icons-sucicon "nf-seti-sbt"           :face nerd-icons-red)
    268     ("scala"          nerd-icons-devicon "nf-dev-scala"          :face nerd-icons-red)
    269     ("scm"            nerd-icons-sucicon "nf-custom-scheme"      :face nerd-icons-red)
    270     ("swift"          nerd-icons-devicon "nf-dev-swift"          :face nerd-icons-green)
    271 
    272     ("tcl"            nerd-icons-mdicon "nf-md-feather"          :face nerd-icons-dred)
    273     ("exp"            nerd-icons-mdicon "nf-md-feather"          :face nerd-icons-dred)
    274 
    275     ("tf"             nerd-icons-mdicon "nf-md-terraform"        :face nerd-icons-purple-alt)
    276     ("tfvars"         nerd-icons-mdicon "nf-md-terraform"        :face nerd-icons-purple-alt)
    277     ("tfstate"        nerd-icons-mdicon "nf-md-terraform"        :face nerd-icons-purple-alt)
    278 
    279     ("asm"            nerd-icons-sucicon "nf-seti-asm"           :face nerd-icons-blue)
    280     ;; Verilog(-AMS) and SystemVerilog(-AMS     ;; Verilog(-AMS) and SystemVerilog(-AMS)
    281     ("v"              nerd-icons-mdicon "nf-md-chip"             :face nerd-icons-red)
    282     ("vams"           nerd-icons-mdicon "nf-md-chip"             :face nerd-icons-red)
    283     ("sv"             nerd-icons-mdicon "nf-md-chip"             :face nerd-icons-red)
    284     ("sva"            nerd-icons-mdicon "nf-md-chip"             :face nerd-icons-red)
    285     ("svh"            nerd-icons-mdicon "nf-md-chip"             :face nerd-icons-red)
    286     ("svams"          nerd-icons-mdicon "nf-md-chip"             :face nerd-icons-red)
    287     ;; VHDL(-AMS     ;; VHDL(-AMS)
    288     ("vhd"            nerd-icons-octicon "nf-oct-cpu"            :face nerd-icons-blue)
    289     ("vhdl"           nerd-icons-octicon "nf-oct-cpu"            :face nerd-icons-blue)
    290     ("vhms"           nerd-icons-octicon "nf-oct-cpu"            :face nerd-icons-blue)
    291     ;; Cabal
    292     ;; ("cabal"       nerd-icons-devicon "cabal") TODO: cabal
    293     ;; Kotlin
    294     ("kt"             nerd-icons-sucicon "nf-seti-kotlin"        :face nerd-icons-orange)
    295     ("kts"            nerd-icons-sucicon "nf-seti-kotlin"        :face nerd-icons-orange)
    296     ;; Nimrod
    297     ("nim"            nerd-icons-sucicon "nf-seti-nim"           :face nerd-icons-yellow)
    298     ("nims"           nerd-icons-sucicon "nf-seti-nim"           :face nerd-icons-yellow)
    299     ;; SQL
    300     ("sql"            nerd-icons-octicon "nf-oct-database"       :face nerd-icons-silver)
    301     ;; Styles
    302     ;; ("styles"      nerd-icons-devicon "style") TODO: style
    303     ;; Lua
    304     ("lua"            nerd-icons-sucicon "nf-seti-lua"           :face nerd-icons-dblue)
    305     ;; ASCII doc
    306     ;; ("adoc"        nerd-icons-devicon "asciidoc") TODO: asciidoc
    307     ;; ("asciidoc"    nerd-icons-devicon "asciidoc") TODO: asciidoc
    308     ;; Puppet
    309     ("pp"             nerd-icons-sucicon "nf-seti-puppet"        :face nerd-icons-yellow)
    310     ;; Jinja
    311     ("j2"             nerd-icons-sucicon "nf-seti-jinja"         :face nerd-icons-silver)
    312     ("jinja2"         nerd-icons-sucicon "nf-seti-jinja"         :face nerd-icons-silver)
    313     ;; Docker
    314     ("dockerfile"     nerd-icons-sucicon "nf-seti-docker"        :face nerd-icons-cyan)
    315     ;; Vagrant
    316     ;; ("vagrantfile" nerd-icons-fileicon "vagrant") TODO: vagrant
    317     ;; GLSL
    318     ("glsl"           nerd-icons-faicon "nf-fa-paint_brush"      :face nerd-icons-blue)
    319     ("vert"           nerd-icons-faicon "nf-fa-paint_brush"      :face nerd-icons-blue)
    320     ("tesc"           nerd-icons-faicon "nf-fa-paint_brush"      :face nerd-icons-purple)
    321     ("tese"           nerd-icons-faicon "nf-fa-paint_brush"      :face nerd-icons-dpurple)
    322     ("geom"           nerd-icons-faicon "nf-fa-paint_brush"      :face nerd-icons-green)
    323     ("frag"           nerd-icons-faicon "nf-fa-paint_brush"      :face nerd-icons-red)
    324     ("comp"           nerd-icons-faicon "nf-fa-paint_brush"      :face nerd-icons-dblue)
    325     ;; CUDA
    326     ("cu"             nerd-icons-sucicon "nf-custom-c"           :face nerd-icons-green)
    327     ("cuh"            nerd-icons-faicon "nf-fa-h_square"         :face nerd-icons-green)
    328     ;; Fortran
    329     ("f90"            nerd-icons-mdicon "nf-md-language_fortran" :face nerd-icons-purple)
    330     ;; C#
    331     ("cs"             nerd-icons-mdicon "nf-md-language_csharp"  :face nerd-icons-dblue)
    332     ("csx"            nerd-icons-mdicon "nf-md-language_csharp"  :face nerd-icons-dblue)
    333     ;; F#
    334     ("fs"             nerd-icons-devicon "nf-dev-fsharp"         :face nerd-icons-blue-alt)
    335     ("fsi"            nerd-icons-devicon "nf-dev-fsharp"         :face nerd-icons-blue-alt)
    336     ("fsx"            nerd-icons-devicon "nf-dev-fsharp"         :face nerd-icons-blue-alt)
    337     ("fsscript"       nerd-icons-devicon "nf-dev-fsharp"         :face nerd-icons-blue-alt)
    338     ;; Godot / GDScript
    339     ("gd"             nerd-icons-sucicon "nf-seti-godot"         :face nerd-icons-blue)
    340     ("tscn"           nerd-icons-codicon "nf-cod-settings"       :face nerd-icons-orange)
    341     ("tres"           nerd-icons-codicon "nf-cod-settings"       :face nerd-icons-orange)
    342     ;; zig
    343     ("zig"            nerd-icons-sucicon "nf-seti-zig"           :face nerd-icons-orange)
    344     ;; odin
    345     ;; ("odin"        nerd-icons-fileicon "odin") TODO: odin
    346     ;; File Types
    347     ("ico"            nerd-icons-octicon "nf-oct-file_media"     :face nerd-icons-blue)
    348     ("png"            nerd-icons-mdicon "nf-md-file_png_box"     :face nerd-icons-orange)
    349     ("gif"            nerd-icons-mdicon "nf-md-file_gif_box"     :face nerd-icons-green)
    350     ("jpeg"           nerd-icons-mdicon "nf-md-file_jpg_box"     :face nerd-icons-dblue)
    351     ("jpg"            nerd-icons-mdicon "nf-md-file_jpg_box"     :face nerd-icons-dblue)
    352     ("webp"           nerd-icons-octicon "nf-oct-file_media"     :face nerd-icons-dblue)
    353     ("xpm"            nerd-icons-octicon "nf-oct-file_media"     :face nerd-icons-dgreen)
    354     ;; Audio
    355     ("mp3"            nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    356     ("wav"            nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    357     ("m4a"            nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    358     ("ogg"            nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    359     ("flac"           nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    360     ("opus"           nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    361     ("au"             nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    362     ("aif"            nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    363     ("aifc"           nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    364     ("aiff"           nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    365     ("svg"            nerd-icons-sucicon "nf-seti-svg"           :face nerd-icons-lgreen)
    366     ;; Video
    367     ("mov"            nerd-icons-faicon "nf-fa-film"             :face nerd-icons-blue)
    368     ("mp4"            nerd-icons-faicon "nf-fa-film"             :face nerd-icons-blue)
    369     ("ogv"            nerd-icons-faicon "nf-fa-film"             :face nerd-icons-dblue)
    370     ("mpg"            nerd-icons-faicon "nf-fa-film"             :face nerd-icons-blue)
    371     ("mpeg"           nerd-icons-faicon "nf-fa-film"             :face nerd-icons-blue)
    372     ("flv"            nerd-icons-faicon "nf-fa-film"             :face nerd-icons-blue)
    373     ("ogv"            nerd-icons-faicon "nf-fa-film"             :face nerd-icons-dblue)
    374     ("mkv"            nerd-icons-faicon "nf-fa-film"             :face nerd-icons-blue)
    375     ("webm"           nerd-icons-faicon "nf-fa-film"             :face nerd-icons-blue)
    376     ;; Fonts
    377     ("ttf"            nerd-icons-faicon "nf-fa-font"             :face nerd-icons-dcyan)
    378     ("woff"           nerd-icons-faicon "nf-fa-font"             :face nerd-icons-cyan)
    379     ("woff2"          nerd-icons-faicon "nf-fa-font"             :face nerd-icons-cyan)
    380     ;; Archives
    381     ("iso"            nerd-icons-mdicon "nf-md-disc"            :face nerd-icons-orange)
    382     ("tar"            nerd-icons-mdicon "nf-md-zip_box"          :face nerd-icons-orange)
    383     ("rar"            nerd-icons-mdicon "nf-md-zip_box"          :face nerd-icons-orange)
    384     ("tgz"            nerd-icons-mdicon "nf-md-zip_box"          :face nerd-icons-orange)
    385     ("jar"            nerd-icons-devicon "nf-dev-java"           :face nerd-icons-dpurple)
    386     ;; Doc
    387     ("pdf"            nerd-icons-codicon "nf-cod-file_pdf"       :face nerd-icons-dred)
    388     ("text"           nerd-icons-faicon "nf-fa-file_text"        :face nerd-icons-cyan)
    389     ("txt"            nerd-icons-faicon "nf-fa-file_text"        :face nerd-icons-cyan)
    390     ("doc"            nerd-icons-mdicon "nf-md-file_word"        :face nerd-icons-blue)
    391     ("docx"           nerd-icons-mdicon "nf-md-file_word"        :face nerd-icons-blue)
    392     ("docm"           nerd-icons-mdicon "nf-md-file_word"        :face nerd-icons-blue)
    393     ("texi"           nerd-icons-sucicon "nf-seti-tex"           :face nerd-icons-lred)
    394     ("tex"            nerd-icons-sucicon "nf-seti-tex"           :face nerd-icons-lred)
    395     ("ltx"            nerd-icons-sucicon "nf-seti-tex"           :face nerd-icons-lred)
    396     ("dtx"            nerd-icons-sucicon "nf-seti-tex"           :face nerd-icons-lred)
    397     ("sty"            nerd-icons-sucicon "nf-seti-tex"           :face nerd-icons-lred)
    398     ("md"             nerd-icons-octicon "nf-oct-markdown"       :face nerd-icons-lblue)
    399     ("bib"            nerd-icons-mdicon "nf-md-book"             :face nerd-icons-lblue)
    400     ("org"            nerd-icons-sucicon "nf-custom-orgmode"     :face nerd-icons-lgreen)
    401     ("org_archive"    nerd-icons-sucicon "nf-custom-orgmode"     :face nerd-icons-lgreen)
    402     ("pps"            nerd-icons-mdicon "nf-md-file_powerpoint"  :face nerd-icons-orange)
    403     ("ppt"            nerd-icons-mdicon "nf-md-file_powerpoint"  :face nerd-icons-orange)
    404     ("pptx"           nerd-icons-mdicon "nf-md-file_powerpoint"  :face nerd-icons-orange)
    405     ("pptsx"          nerd-icons-mdicon "nf-md-file_powerpoint"  :face nerd-icons-orange)
    406     ("ppttx"          nerd-icons-mdicon "nf-md-file_powerpoint"  :face nerd-icons-orange)
    407     ("knt"            nerd-icons-mdicon "nf-md-file_powerpoint"  :face nerd-icons-cyan)
    408     ("xlsx"           nerd-icons-mdicon "nf-md-file_excel"       :face nerd-icons-dgreen)
    409     ("xlsm"           nerd-icons-mdicon "nf-md-file_excel"       :face nerd-icons-dgreen)
    410     ("xlsb"           nerd-icons-mdicon "nf-md-file_excel"       :face nerd-icons-dgreen)
    411     ("xltx"           nerd-icons-mdicon "nf-md-file_excel"       :face nerd-icons-dgreen)
    412     ("xltm"           nerd-icons-mdicon "nf-md-file_excel"       :face nerd-icons-dgreen)
    413     ("epub"           nerd-icons-mdicon "nf-md-book_open"        :face nerd-icons-green)
    414     ("ly"             nerd-icons-faicon "nf-fa-music"            :face nerd-icons-green)
    415     ;;
    416     ("key"            nerd-icons-octicon "nf-oct-key"            :face nerd-icons-lblue)
    417     ("pem"            nerd-icons-octicon "nf-oct-key"            :face nerd-icons-orange)
    418     ("p12"            nerd-icons-octicon "nf-oct-key"            :face nerd-icons-dorange)
    419     ("crt"            nerd-icons-octicon "nf-oct-key"            :face nerd-icons-lblue)
    420     ("pub"            nerd-icons-octicon "nf-oct-key"            :face nerd-icons-blue)
    421     ("gpg"            nerd-icons-octicon "nf-oct-key"            :face nerd-icons-lblue)
    422     ("kdbx"           nerd-icons-octicon "nf-oct-key"            :face nerd-icons-green)
    423     ("cache"          nerd-icons-octicon "nf-oct-database"       :face nerd-icons-green)
    424     ;; backup
    425     ("backup"         nerd-icons-mdicon "nf-md-file_restore"     :face nerd-icons-lblue)
    426     ("old"            nerd-icons-mdicon "nf-md-file_restore"     :face nerd-icons-lblue)
    427     ("bak"            nerd-icons-mdicon "nf-md-file_restore"     :face nerd-icons-lblue)))
    428 
    429 (defvar                        nerd-icons-regexp-icon-alist
    430   '(
    431     ;;
    432     ("^TAGS$"                  nerd-icons-octicon "nf-oct-tag"               :face nerd-icons-blue)
    433     ("^TODO$"                  nerd-icons-octicon "nf-oct-checklist"         :face nerd-icons-lyellow)
    434     ("^LICENSE$"               nerd-icons-octicon "nf-oct-book"              :face nerd-icons-blue)
    435     ("^readme"                 nerd-icons-octicon "nf-oct-book"              :face nerd-icons-lcyan)
    436 
    437     ;; Config
    438     ("nginx$"                  nerd-icons-devicon "nf-dev-nginx"             :face nerd-icons-dgreen)
    439     ;; ("apache$"              nerd-icons-alltheicon "apache") TODO: apache
    440 
    441     ;; C
    442     ("^Makefile$"              nerd-icons-sucicon "nf-seti-makefile"         :face nerd-icons-dorange)
    443     ("^CMakeLists.txt$"        nerd-icons-sucicon "nf-seti-makefile"         :face nerd-icons-red) ;; TODO: cmake
    444     ("^CMakeCache.txt$"        nerd-icons-sucicon "nf-seti-makefile"         :face nerd-icons-blue) ;; TODO: cmakecache
    445     ("^meson.build$"           nerd-icons-sucicon "nf-seti-makefile"         :face nerd-icons-purple) ;; TODO: meson
    446     ("^meson_options.txt$"     nerd-icons-sucicon "nf-seti-makefile"         :face nerd-icons-purple) ;; TODO: meson
    447 
    448     ;; Docker
    449     ("^\\.?Dockerfile"         nerd-icons-sucicon "nf-seti-docker"           :face nerd-icons-blue)
    450 
    451     ;; Homebrew
    452     ("^Brewfile$"              nerd-icons-faicon "nf-fa-beer"                :face nerd-icons-lsilver)
    453 
    454     ;; ;; AWS
    455     ("^stack.*.json$"          nerd-icons-devicon "nf-dev-aws"               :face nerd-icons-orange)
    456     ("^serverless\\.yml$"      nerd-icons-faicon "nf-fa-bolt"                :face nerd-icons-yellow)
    457 
    458     ;; lock files
    459     ("~$"                      nerd-icons-octicon "nf-oct-lock"              :face nerd-icons-maroon)
    460 
    461     ;; Source Codes
    462     ("^mix.lock$"              nerd-icons-sucicon "nf-seti-elixir"           :face nerd-icons-lyellow)
    463 
    464     ;; Ruby
    465     ("^Gemfile\\(\\.lock\\)?$" nerd-icons-octicon "nf-oct-ruby"              :face nerd-icons-red)
    466     ("_?test\\.rb$"            nerd-icons-octicon "nf-oct-ruby"              :face nerd-icons-red)
    467     ("_?test_helper\\.rb$"     nerd-icons-octicon "nf-oct-ruby"              :face nerd-icons-dred)
    468     ("_?spec\\.rb$"            nerd-icons-octicon "nf-oct-ruby"              :face nerd-icons-red)
    469     ("_?spec_helper\\.rb$"     nerd-icons-octicon "nf-oct-ruby"              :face nerd-icons-dred)
    470 
    471     ("-?spec\\.ts$"            nerd-icons-mdicon "nf-md-language_typescript" :face nerd-icons-blue)
    472     ("-?test\\.ts$"            nerd-icons-mdicon "nf-md-language_typescript" :face nerd-icons-blue)
    473     ("-?spec\\.js$"            nerd-icons-mdicon "nf-md-language_javascript" :face nerd-icons-lpurple)
    474     ("-?test\\.js$"            nerd-icons-mdicon "nf-md-language_javascript" :face nerd-icons-lpurple)
    475     ("-?spec\\.jsx$"           nerd-icons-mdicon "nf-md-react"               :face nerd-icons-blue-alt)
    476     ("-?test\\.jsx$"           nerd-icons-mdicon "nf-md-react"               :face nerd-icons-blue-alt)
    477 
    478     ;; Git
    479     ("^MERGE_"                 nerd-icons-octicon "nf-oct-git_merge"         :face nerd-icons-red)
    480     ("^COMMIT_EDITMSG"         nerd-icons-octicon "nf-oct-git_commit"        :face nerd-icons-red)
    481 
    482     ;; Stylesheeting
    483     ("^stylelint"               nerd-icons-sucicon "nf-seti-stylelint"        :face nerd-icons-lyellow)
    484 
    485     ;; JavaScript
    486     ("^package.json$"          nerd-icons-devicon "nf-dev-npm"               :face nerd-icons-red)
    487     ("^package.lock.json$"     nerd-icons-devicon "nf-dev-npm"               :face nerd-icons-dred)
    488     ("^yarn\\.lock"            nerd-icons-sucicon "nf-seti-yarn"             :face nerd-icons-blue-alt)
    489     ("\\.npmignore$"           nerd-icons-devicon "nf-dev-npm"               :face nerd-icons-dred)
    490     ("^bower.json$"            nerd-icons-devicon "nf-dev-bower"             :face nerd-icons-lorange)
    491     ("^gulpfile"               nerd-icons-devicon "nf-dev-gulp"              :face nerd-icons-lred)
    492     ("^gruntfile"              nerd-icons-devicon "nf-dev-grunt"             :face nerd-icons-lyellow)
    493     ("^webpack"                nerd-icons-mdicon "nf-md-webpack"             :face nerd-icons-lblue)
    494 
    495     ;; Go
    496     ("^go.mod$"                nerd-icons-sucicon "nf-seti-config"           :face nerd-icons-blue-alt)
    497     ("^go.work$"               nerd-icons-sucicon "nf-seti-config"           :face nerd-icons-blue-alt)
    498 
    499     ;; Groovy
    500     ("Jenkinsfile\\'"          nerd-icons-devicon "nf-dev-groovy"            :face nerd-icons-cyan-alt)
    501 
    502     ;; Emacs
    503     ("^bookmark"                nerd-icons-octicon "nf-oct-bookmark"          :face nerd-icons-lpink)
    504 
    505     ("^\\*scratch\\*$"         nerd-icons-faicon "nf-fa-sticky_note"         :face nerd-icons-lyellow)
    506     ("^\\*scratch.*"           nerd-icons-faicon "nf-fa-sticky_note"         :face nerd-icons-yellow)
    507     ("^\\*new-tab\\*$"         nerd-icons-mdicon "nf-md-star"                :face nerd-icons-cyan)
    508     ("Cask\\'"                 nerd-icons-sucicon "nf-custom-emacs"          :face nerd-icons-blue)
    509     ("Eask\\'"                 nerd-icons-sucicon "nf-custom-emacs"          :face nerd-icons-blue)
    510 
    511     ("^\\."                    nerd-icons-octicon "nf-oct-gear")))
    512 
    513 (defvar nerd-icons-default-file-icon
    514   '(nerd-icons-faicon "nf-fa-file_o"))
    515 
    516 (defvar nerd-icons-dir-icon-alist
    517   '(
    518     ("trash"            nerd-icons-faicon "nf-fa-trash_o")
    519     ("dropbox"          nerd-icons-faicon "nf-fa-dropbox")
    520     ("google[ _-]drive" nerd-icons-mdicon "nf-md-folder_google_drive")
    521     ("github"           nerd-icons-sucicon "nf-custom-folder_github")
    522     ("^atom$"           nerd-icons-devicon "nf-dev-atom")
    523     ("documents"        nerd-icons-mdicon "nf-md-folder_file")
    524     ("download"         nerd-icons-mdicon "nf-md-folder_download")
    525     ("desktop"          nerd-icons-octicon "nf-oct-device_desktop")
    526     ("pictures"         nerd-icons-mdicon "nf-md-folder_image")
    527     ("photos"           nerd-icons-faicon "nf-fa-camera_retro")
    528     ("music"            nerd-icons-mdicon "nf-md-folder_music")
    529     ("movies"           nerd-icons-faicon "nf-fa-film")
    530     ("code"             nerd-icons-octicon "nf-oct-code")
    531     ("workspace"        nerd-icons-octicon "nf-oct-code")
    532     ;; ("test"             nerd-icons-devicon "test-dir")
    533     ("\\.git"           nerd-icons-sucicon "nf-custom-folder_git")
    534     ("\\.config"        nerd-icons-sucicon "nf-custom-folder_config")
    535     (".?"               nerd-icons-sucicon "nf-custom-folder_oct")))
    536 
    537 (defvar nerd-icons-weather-icon-alist
    538   '(
    539     ("tornado"               nerd-icons-wicon "nf-weather-tornado")
    540     ("hurricane"             nerd-icons-wicon "nf-weather-hurricane")
    541     ("thunderstorms"         nerd-icons-wicon "nf-weather-thunderstorm")
    542     ("sunny"                 nerd-icons-wicon "nf-weather-day_sunny")
    543     ("rain.*snow"            nerd-icons-wicon "nf-weather-rain_mix")
    544     ("rain.*hail"            nerd-icons-wicon "nf-weather-rain_mix")
    545     ("sleet"                 nerd-icons-wicon "nf-weather-sleet")
    546     ("hail"                  nerd-icons-wicon "nf-weather-hail")
    547     ("drizzle"               nerd-icons-wicon "nf-weather-sprinkle")
    548     ("rain"                  nerd-icons-wicon "nf-weather-showers")
    549     ("showers"               nerd-icons-wicon "nf-weather-showers")
    550     ("blowing.*snow"         nerd-icons-wicon "nf-weather-snow_wind")
    551     ("snow"                  nerd-icons-wicon "nf-weather-snow")
    552     ("dust"                  nerd-icons-wicon "nf-weather-dust")
    553     ("fog"                   nerd-icons-wicon "nf-weather-fog")
    554     ("haze"                  nerd-icons-wicon "nf-weather-day_haze")
    555     ("smoky"                 nerd-icons-wicon "nf-weather-smoke")
    556     ("blustery"              nerd-icons-wicon "nf-weather-cloudy_windy")
    557     ("windy"                 nerd-icons-wicon "nf-weather-cloudy_gusts")
    558     ("cold"                  nerd-icons-wicon "nf-weather-snowflake_cold")
    559     ("partly.*cloudy.*night" nerd-icons-wicon "nf-weather-night_alt_partly_cloudy")
    560     ("partly.*cloudy"        nerd-icons-wicon "nf-weather-day_cloudy_high")
    561     ("cloudy.*night"         nerd-icons-wicon "nf-weather-night_alt_cloudy")
    562     ("cxloudy.*day"          nerd-icons-wicon "nf-weather-day_cloudy")
    563     ("cloudy"                nerd-icons-wicon "nf-weather-cloudy")
    564     ("clear.*night"          nerd-icons-wicon "nf-weather-night_clear")
    565     ("fair.*night"           nerd-icons-wicon "nf-weather-stars")
    566     ("fair.*day"             nerd-icons-wicon "nf-weather-horizon")
    567     ("hot"                   nerd-icons-wicon "nf-weather-hot")
    568     ("not.*available"        nerd-icons-wicon "nf-weather-na")))
    569 
    570 (defvar nerd-icons-mode-icon-alist
    571   '(
    572     (emacs-lisp-mode                   nerd-icons-sucicon "nf-custom-emacs"           :face nerd-icons-purple)
    573     (circe-server-mode                 nerd-icons-faicon "nf-fa-commenting_o")
    574     (circe-channel-mode                nerd-icons-faicon "nf-fa-commenting_o")
    575     (circe-query-mode                  nerd-icons-faicon "nf-fa-commenting_o")
    576     (crystal-mode                      nerd-icons-sucicon "nf-custom-crystal"         :face nerd-icons-yellow)
    577     (erc-mode                          nerd-icons-faicon "nf-fa-commenting_o")
    578     (inferior-emacs-lisp-mode          nerd-icons-sucicon "nf-custom-emacs"           :face nerd-icons-lblue)
    579     (dired-mode                        nerd-icons-octicon "nf-oct-file_directory")
    580     (lisp-interaction-mode             nerd-icons-sucicon "nf-custom-emacs"           :face nerd-icons-orange)
    581     (sly-mrepl-mode                    nerd-icons-sucicon "nf-custom-common_lisp"     :face nerd-icons-orange)
    582     (slime-repl-mode                   nerd-icons-sucicon "nf-custom-common_lisp"     :face nerd-icons-orange)
    583     (org-mode                          nerd-icons-sucicon "nf-custom-orgmode"         :face nerd-icons-lgreen)
    584     (ledger-mode                       nerd-icons-mdicon "nf-md-file_table_box_multiple"   :face nerd-icons-green)
    585     (typescript-mode                   nerd-icons-mdicon "nf-md-language_typescript"  :face nerd-icons-blue-alt)
    586     (typescript-ts-mode                nerd-icons-mdicon "nf-md-language_typescript"  :face nerd-icons-blue-alt)
    587     (typescript-tsx-mode               nerd-icons-mdicon "nf-md-language_typescript"  :face nerd-icons-blue-alt)
    588     (tsx-ts-mode                       nerd-icons-mdicon "nf-md-language_typescript"  :face nerd-icons-blue-alt)
    589     (js-mode                           nerd-icons-devicon "nf-dev-javascript"         :face nerd-icons-yellow)
    590     (js-ts-mode                        nerd-icons-devicon "nf-dev-javascript"         :face nerd-icons-yellow)
    591     (js-jsx-mode                       nerd-icons-devicon "nf-dev-javascript"         :face nerd-icons-yellow)
    592     (js2-mode                          nerd-icons-devicon "nf-dev-javascript"         :face nerd-icons-yellow)
    593     (js3-mode                          nerd-icons-devicon "nf-dev-javascript"         :face nerd-icons-yellow)
    594     (rjsx-mode                         nerd-icons-devicon "nf-dev-javascript"         :face nerd-icons-cyan-alt)
    595     (term-mode                         nerd-icons-devicon "nf-dev-terminal")
    596     (vterm-mode                        nerd-icons-devicon "nf-dev-terminal")
    597     (eat-mode                          nerd-icons-devicon "nf-dev-terminal")
    598     (eshell-mode                       nerd-icons-devicon "nf-dev-terminal"           :face nerd-icons-purple)
    599     (magit-refs-mode                   nerd-icons-devicon "nf-dev-git_branch"         :face nerd-icons-red)
    600     (magit-process-mode                nerd-icons-octicon "nf-oct-mark_github")
    601     (magit-diff-mode                   nerd-icons-devicon "nf-dev-git_compare"        :face nerd-icons-lblue)
    602     (ediff-mode                        nerd-icons-devicon "nf-dev-git_compare"        :face nerd-icons-red)
    603     (diff-mode                         nerd-icons-devicon "nf-dev-git_compare"        :face nerd-icons-lred)
    604     (comint-mode                       nerd-icons-faicon "nf-fa-terminal"             :face nerd-icons-lblue)
    605     (eww-mode                          nerd-icons-faicon "nf-fa-firefox"              :face nerd-icons-red)
    606     (xwidget-webkit-mode               nerd-icons-faicon "nf-fa-chrome"               :face nerd-icons-blue)
    607     (org-agenda-mode                   nerd-icons-octicon "nf-oct-checklist"          :face nerd-icons-lgreen)
    608     (cfw:calendar-mode                 nerd-icons-octicon "nf-oct-calendar")
    609     (ibuffer-mode                      nerd-icons-faicon "nf-fa-files_o"              :face nerd-icons-dsilver)
    610     (messages-buffer-mode              nerd-icons-faicon "nf-fa-file_o"               :face nerd-icons-dsilver)
    611     (help-mode                         nerd-icons-faicon "nf-fa-info"                 :face nerd-icons-purple)
    612     (helpful-mode                      nerd-icons-faicon "nf-fa-info"                 :face nerd-icons-purple)
    613     (Info-mode                         nerd-icons-faicon "nf-fa-info"                 :face nerd-icons-blue)
    614     (benchmark-init/tree-mode          nerd-icons-faicon "nf-fa-dashboard")
    615     (jenkins-mode                      nerd-icons-devicon "nf-dev-jenkins"            :face nerd-icons-blue)
    616     (magit-popup-mode                  nerd-icons-sucicon "nf-seti-git"               :face nerd-icons-red)
    617     (magit-status-mode                 nerd-icons-sucicon "nf-seti-git"               :face nerd-icons-lred)
    618     (magit-log-mode                    nerd-icons-sucicon "nf-seti-git"               :face nerd-icons-green)
    619     (mu4e-compose-mode                 nerd-icons-octicon "nf-oct-pencil")
    620     (mu4e-headers-mode                 nerd-icons-octicon "nf-oct-mail")
    621     (mu4e-main-mode                    nerd-icons-octicon "nf-oct-mail")
    622     (mu4e-view-mode                    nerd-icons-codicon "nf-cod-mail_read")
    623     (notmuch-hello-mode                nerd-icons-octicon "nf-oct-mail")
    624     (notmuch-search-mode               nerd-icons-octicon "nf-oct-mail")
    625     (notmuch-tree-mode                 nerd-icons-octicon "nf-oct-mail")
    626     (notmuch-show-mode                 nerd-icons-codicon "nf-cod-mail_read")
    627     (sieve-mode                        nerd-icons-octicon "nf-oct-mail")
    628     (gnus-group-mode                   nerd-icons-octicon "nf-oct-mail")
    629     (gnus-summary-mode                 nerd-icons-octicon "nf-oct-mail")
    630     (gnus-article-mode                 nerd-icons-codicon "nf-cod-mail_read")
    631     (message-mode                      nerd-icons-octicon "nf-oct-pencil")
    632     (package-menu-mode                 nerd-icons-faicon "nf-fa-archive"              :face nerd-icons-silver)
    633     (paradox-menu-mode                 nerd-icons-faicon "nf-fa-archive"              :face nerd-icons-silver)
    634     (Custom-mode                       nerd-icons-codicon "nf-cod-settings")
    635 
    636     ;; Special matcher for Web Mode based on the `web-mode-content-type' of the current buffer
    637     (web-mode                          nerd-icons--web-mode-icon)
    638 
    639     (fundamental-mode                  nerd-icons-sucicon "nf-custom-emacs"           :face nerd-icons-dsilver)
    640     (special-mode                      nerd-icons-sucicon "nf-custom-emacs"           :face nerd-icons-yellow)
    641     (cask-mode                         nerd-icons-sucicon "nf-custom-emacs"           :face nerd-icons-blue)
    642     (eask-mode                         nerd-icons-sucicon "nf-custom-emacs"           :face nerd-icons-blue)
    643     (text-mode                         nerd-icons-faicon "nf-fa-file_text"            :face nerd-icons-cyan)
    644     (enh-ruby-mode                     nerd-icons-devicon "nf-dev-ruby"               :face nerd-icons-lred)
    645     (ruby-mode                         nerd-icons-devicon "nf-dev-ruby"               :face nerd-icons-lred)
    646     (ruby-ts-mode                      nerd-icons-devicon "nf-dev-ruby"               :face nerd-icons-lred)
    647     (inf-ruby-mode                     nerd-icons-devicon "nf-dev-ruby"               :face nerd-icons-red)
    648     (projectile-rails-compilation-mode nerd-icons-devicon "nf-dev-ruby"               :face nerd-icons-red)
    649     (rspec-compilation-mode            nerd-icons-devicon "nf-dev-ruby"               :face nerd-icons-red)
    650     (rake-compilation-mode             nerd-icons-devicon "nf-dev-ruby"               :face nerd-icons-red)
    651     (sh-mode                           nerd-icons-devicon "nf-dev-terminal"           :face nerd-icons-purple)
    652     (bash-ts-mode                      nerd-icons-devicon "nf-dev-terminal"           :face nerd-icons-purple)
    653     (shell-mode                        nerd-icons-devicon "nf-dev-terminal"           :face nerd-icons-purple)
    654     (fish-mode                         nerd-icons-devicon "nf-dev-terminal"           :face nerd-icons-lpink)
    655     (bat-mode                          nerd-icons-codicon "nf-cod-terminal_cmd"       :face nerd-icons-lsilver)
    656     (nginx-mode                        nerd-icons-devicon "nf-dev-nginx"              :face nerd-icons-dgreen)
    657     ;; (apache-mode                    nerd-icons-alltheicon "apache"                 :face nerd-icons-dgreen)
    658     (makefile-mode                     nerd-icons-devicon "nf-dev-gnu"                :face nerd-icons-dorange)
    659     (makefile-ts-mode                  nerd-icons-devicon "nf-dev-gnu"                :face nerd-icons-dorange)
    660     ;; (cmake-mode                     nerd-icons-fileicon "cmake"                    :face nerd-icons-red)
    661     ;; (cmake-ts-mode                  nerd-icons-fileicon "cmake"                    :face nerd-icons-red)
    662     (dockerfile-mode                   nerd-icons-sucicon "nf-seti-docker"            :face nerd-icons-blue)
    663     (dockerfile-ts-mode                nerd-icons-sucicon "nf-seti-docker"            :face nerd-icons-blue)
    664     (docker-compose-mode               nerd-icons-sucicon "nf-seti-docker"            :face nerd-icons-lblue)
    665     (nxml-mode                         nerd-icons-faicon "nf-fa-file_code_o"          :face nerd-icons-lorange)
    666     (conf-mode                         nerd-icons-codicon "nf-cod-settings"           :face nerd-icons-lyellow)
    667     (json-mode                         nerd-icons-codicon "nf-cod-settings"           :face nerd-icons-yellow)
    668     (json-ts-mode                      nerd-icons-codicon "nf-cod-settings"           :face nerd-icons-yellow)
    669     (jsonian-mode                      nerd-icons-codicon "nf-cod-settings"           :face nerd-icons-yellow)
    670     (yaml-mode                         nerd-icons-codicon "nf-cod-settings"           :face nerd-icons-dyellow)
    671     (yaml-ts-mode                      nerd-icons-codicon "nf-cod-settings"           :face nerd-icons-dyellow)
    672     (toml-mode                         nerd-icons-codicon "nf-cod-settings"           :face nerd-icons-orange)
    673     (toml-ts-mode                      nerd-icons-codicon "nf-cod-settings"           :face nerd-icons-orange)
    674     (elisp-byte-code-mode              nerd-icons-octicon "nf-oct-file_binary"        :face nerd-icons-dsilver)
    675     (archive-mode                      nerd-icons-octicon "nf-oct-file_zip"           :face nerd-icons-lmaroon)
    676     (elm-mode                          nerd-icons-sucicon "nf-custom-elm"             :face nerd-icons-blue)
    677     (erlang-mode                       nerd-icons-devicon "nf-dev-erlang"             :face nerd-icons-red)
    678     (elixir-mode                       nerd-icons-sucicon "nf-custom-elixir"          :face nerd-icons-lorange)
    679     (elixir-ts-mode                    nerd-icons-sucicon "nf-custom-elixir"          :face nerd-icons-lorange)
    680     (java-mode                         nerd-icons-devicon "nf-dev-java"               :face nerd-icons-purple)
    681     (groovy-mode                       nerd-icons-devicon "nf-dev-groovy"             :face nerd-icons-cyan)
    682     (java-ts-mode                      nerd-icons-devicon "nf-dev-java"               :face nerd-icons-purple)
    683     (go-mode                           nerd-icons-devicon "nf-dev-go"                 :face nerd-icons-blue)
    684     (go-ts-mode                        nerd-icons-devicon "nf-dev-go"                 :face nerd-icons-blue)
    685     (go-dot-mod-mode                   nerd-icons-sucicon "nf-seti-config"            :face nerd-icons-blue-alt)
    686     (go-mod-ts-mode                    nerd-icons-sucicon "nf-seti-config"            :face nerd-icons-blue-alt)
    687     (go-dot-work-mode                  nerd-icons-sucicon "nf-seti-config"            :face nerd-icons-blue-alt)
    688     (graphql-mode                      nerd-icons-sucicon "nf-seti-graphql"           :face nerd-icons-dpink)
    689     ;; (matlab-mode                    nerd-icons-fileicon "matlab"                   :face nerd-icons-orange)
    690     (nix-mode                          nerd-icons-mdicon "nf-md-nix"                  :face nerd-icons-blue)
    691     (perl-mode                         nerd-icons-devicon "nf-dev-perl"               :face nerd-icons-lorange)
    692     (cperl-mode                        nerd-icons-devicon "nf-dev-perl"               :face nerd-icons-lorange)
    693     (php-mode                          nerd-icons-devicon "nf-dev-php"                :face nerd-icons-lsilver)
    694     (php-ts-mode                       nerd-icons-devicon "nf-dev-php"                :face nerd-icons-lsilver)
    695     (prolog-mode                       nerd-icons-devicon "nf-dev-prolog"             :face nerd-icons-lmaroon)
    696     (python-mode                       nerd-icons-devicon "nf-dev-python"             :face nerd-icons-dblue)
    697     (python-ts-mode                    nerd-icons-devicon "nf-dev-python"             :face nerd-icons-dblue)
    698     (inferior-python-mode              nerd-icons-devicon "nf-dev-python"             :face nerd-icons-dblue)
    699     ;; (racket-mode                    nerd-icons-fileicon "racket"                   :face nerd-icons-red)
    700     (rust-mode                         nerd-icons-devicon "nf-dev-rust"               :face nerd-icons-maroon)
    701     (rustic-mode                       nerd-icons-devicon "nf-dev-rust"               :face nerd-icons-maroon)
    702     (rust-ts-mode                      nerd-icons-devicon "nf-dev-rust"               :face nerd-icons-maroon)
    703     (scala-mode                        nerd-icons-devicon "nf-dev-scala"              :face nerd-icons-red)
    704     ;; (scheme-mode                    nerd-icons-fileicon   "scheme"                 :face nerd-icons-red)
    705     (swift-mode                        nerd-icons-devicon "nf-dev-swift"              :face nerd-icons-green)
    706     (svelte-mode                       nerd-icons-sucicon "nf-seti-svelte"            :face nerd-icons-red)
    707     (ada-mode                          nerd-icons-sucicon "nf-custom-ada"             :face nerd-icons-blue)
    708     (ada-ts-mode                       nerd-icons-sucicon "nf-custom-ada"             :face nerd-icons-blue)
    709     (gpr-mode                          nerd-icons-sucicon "nf-custom-ada"             :face nerd-icons-green)
    710     (gpr-ts-mode                       nerd-icons-sucicon "nf-custom-ada"             :face nerd-icons-green)
    711     (c-mode                            nerd-icons-sucicon "nf-custom-c"               :face nerd-icons-blue)
    712     (c-ts-mode                         nerd-icons-sucicon "nf-custom-c"               :face nerd-icons-blue)
    713     (c++-mode                          nerd-icons-sucicon "nf-custom-cpp"             :face nerd-icons-blue)
    714     (c++-ts-mode                       nerd-icons-sucicon "nf-custom-cpp"             :face nerd-icons-blue)
    715     (csharp-mode                       nerd-icons-mdicon "nf-md-language_csharp"      :face nerd-icons-dblue)
    716     (csharp-ts-mode                    nerd-icons-mdicon "nf-md-language_csharp"      :face nerd-icons-dblue)
    717     (clojure-mode                      nerd-icons-devicon "nf-dev-clojure_alt"        :face nerd-icons-blue)
    718     (clojure-ts-mode                   nerd-icons-devicon "nf-dev-clojure_alt"        :face nerd-icons-blue)
    719     (cider-repl-mode                   nerd-icons-devicon "nf-dev-clojure_alt"        :face nerd-icons-green)
    720     (clojurec-mode                     nerd-icons-sucicon "nf-seti-clojure"           :face nerd-icons-blue)
    721     (clojurec-ts-mode                  nerd-icons-sucicon "nf-seti-clojure"           :face nerd-icons-blue)
    722     (clojurescript-mode                nerd-icons-devicon "nf-dev-clojure_alt"        :face nerd-icons-lyellow)
    723     (clojurescript-ts-mode             nerd-icons-devicon "nf-dev-clojure_alt"        :face nerd-icons-lyellow)
    724     (coffee-mode                       nerd-icons-devicon "nf-dev-coffeescript"       :face nerd-icons-maroon)
    725     (lisp-mode                         nerd-icons-sucicon "nf-custom-scheme"          :face nerd-icons-orange)
    726     (css-mode                          nerd-icons-devicon "nf-dev-css3"               :face nerd-icons-yellow)
    727     (css-ts-mode                       nerd-icons-devicon "nf-dev-css3"               :face nerd-icons-yellow)
    728     (scss-mode                         nerd-icons-mdicon "nf-md-sass"                 :face nerd-icons-pink)
    729     (sass-mode                         nerd-icons-mdicon "nf-md-sass"                 :face nerd-icons-dpink)
    730     (less-css-mode                     nerd-icons-devicon "nf-dev-less"               :face nerd-icons-dyellow)
    731     (stylus-mode                       nerd-icons-devicon "nf-dev-stylus"             :face nerd-icons-lgreen)
    732     (csv-mode                          nerd-icons-octicon "nf-oct-graph"              :face nerd-icons-dblue)
    733     (gdscript-mode                     nerd-icons-sucicon "nf-seti-godot"             :face nerd-icons-blue)
    734     (gdscript-ts-mode                  nerd-icons-sucicon "nf-seti-godot"             :face nerd-icons-blue)
    735     (haskell-mode                      nerd-icons-devicon "nf-dev-haskell"            :face nerd-icons-red)
    736     (haskell-c2hs-mode                 nerd-icons-devicon "nf-dev-haskell"            :face nerd-icons-red)
    737     (literate-haskell-mode             nerd-icons-devicon "nf-dev-haskell"            :face nerd-icons-red)
    738     (haml-mode                         nerd-icons-sucicon "nf-seti-haml"              :face nerd-icons-lyellow)
    739     (html-mode                         nerd-icons-devicon "nf-dev-html5"              :face nerd-icons-orange)
    740     (html-ts-mode                      nerd-icons-devicon "nf-dev-html5"              :face nerd-icons-orange)
    741     (rhtml-mode                        nerd-icons-devicon "nf-dev-html5"              :face nerd-icons-lred)
    742     ;; (mustache-mode                  nerd-icons-fileicon "moustache"                :face nerd-icons-green)
    743     (slim-mode                         nerd-icons-codicon "nf-cod-dashboard"          :face nerd-icons-yellow)
    744     (jade-mode                         nerd-icons-sucicon "nf-seti-jade"              :face nerd-icons-red)
    745     (pug-mode                          nerd-icons-sucicon "nf-seti-pug"               :face nerd-icons-red)
    746     (react-mode                        nerd-icons-devicon "nf-dev-react"              :face nerd-icons-lblue)
    747     (image-mode                        nerd-icons-octicon "nf-oct-file_media"         :face nerd-icons-blue)
    748     (texinfo-mode                      nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    749     (markdown-mode                     nerd-icons-octicon "nf-oct-markdown"           :face nerd-icons-lblue)
    750     (markdown-ts-mode                  nerd-icons-octicon "nf-oct-markdown"           :face nerd-icons-lblue)
    751     ;; (bibtex-mode                    nerd-icons-fileicon "bib"                      :face nerd-icons-maroon)
    752     (compilation-mode                  nerd-icons-faicon "nf-fa-cogs")
    753     (objc-mode                         nerd-icons-faicon "nf-fa-apple")
    754     (tuareg-mode                       nerd-icons-sucicon "nf-seti-ocaml")
    755     (purescript-mode                   nerd-icons-sucicon "nf-seti-purescript")
    756     (verilog-mode                      nerd-icons-mdicon "nf-md-chip"                 :face nerd-icons-red)
    757     (verilog-ts-mode                   nerd-icons-mdicon "nf-md-chip"                 :face nerd-icons-red)
    758     (vhdl-mode                         nerd-icons-octicon "nf-oct-cpu"                :face nerd-icons-blue)
    759     (vhdl-ts-mode                      nerd-icons-octicon "nf-oct-cpu"                :face nerd-icons-blue)
    760     ;; (haskell-cabal-mode             nerd-icons-fileicon "cabal"                    :face nerd-icons-lblue)
    761     (kotlin-mode                       nerd-icons-sucicon "nf-custom-kotlin"          :face nerd-icons-orange)
    762     (kotlin-ts-mode                    nerd-icons-sucicon "nf-custom-kotlin"          :face nerd-icons-orange)
    763     (nim-mode                          nerd-icons-sucicon "nf-seti-nim"               :face nerd-icons-yellow)
    764     (sql-mode                          nerd-icons-devicon  "nf-dev-database"          :face nerd-icons-silver)
    765     (lua-mode                          nerd-icons-sucicon "nf-seti-lua"               :face nerd-icons-dblue)
    766     (lua-ts-mode                       nerd-icons-sucicon "nf-seti-lua"               :face nerd-icons-dblue)
    767     ;; (adoc-mode                      nerd-icons-fileicon "asciidoc"                 :face nerd-icons-lblue)
    768     (puppet-mode                       nerd-icons-sucicon "nf-custom-puppet"          :face nerd-icons-yellow)
    769     (jinja2-mode                       nerd-icons-sucicon "nf-seti-jinja"             :face nerd-icons-silver)
    770     (powershell-mode                   nerd-icons-mdicon "nf-md-powershell"           :face nerd-icons-blue)
    771     (tex-mode                          nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    772     (latex-mode                        nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    773     (latex-ts-mode                     nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    774     (doctex-mode                       nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    775     ;; Modes provided by AUCTeX 14.1 and higher
    776     (TeX-mode                          nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    777     (LaTeX-mode                        nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    778     (docTeX-mode                       nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    779     (ConTeXt-mode                      nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    780     (AmSTeX-mode                       nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    781     (plain-TeX-mode                    nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    782     (Texinfo-mode                      nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    783     (japanese-plain-TeX-mode           nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    784     (japanese-LaTeX-mode               nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    785     (dart-mode                         nerd-icons-devicon "nf-dev-dart"               :face nerd-icons-blue)
    786     (fsharp-mode                       nerd-icons-devicon "nf-dev-fsharp"             :face nerd-icons-blue)
    787     (asm-mode                          nerd-icons-sucicon "nf-seti-asm"               :face nerd-icons-blue)
    788     (fasm-mode                         nerd-icons-sucicon "nf-seti-asm"               :face nerd-icons-blue)
    789     (masm-mode                         nerd-icons-sucicon "nf-seti-asm"               :face nerd-icons-blue)
    790     (nasm-mode                         nerd-icons-sucicon "nf-seti-asm"               :face nerd-icons-blue)
    791     (gas-mode                          nerd-icons-sucicon "nf-seti-asm"               :face nerd-icons-blue)
    792     ;; (tcl-mode                       nerd-icons-fileicon "tcl"                      :face nerd-icons-dred)
    793     ;; (cuda-mode                      nerd-icons-fileicon "nvidia"                   :face nerd-icons-green)
    794     (f90-mode                          nerd-icons-mdicon "nf-md-language_fortran"     :face nerd-icons-purple)
    795     ;; (hy-mode                        nerd-icons-fileicon "hy"                       :face nerd-icons-blue)
    796     (glsl-mode                         nerd-icons-faicon "nf-fa-paint_brush"          :face nerd-icons-green)
    797     (zig-mode                          nerd-icons-sucicon "nf-seti-zig"               :face nerd-icons-orange)
    798     ;; (odin-mode                      nerd-icons-fileicon "odin"                     :face nerd-icons-lblue)
    799     (pdf-view-mode                     nerd-icons-codicon  "nf-cod-file_pdf"          :face nerd-icons-dred)
    800     (doc-view-mode                     nerd-icons-mdicon   "nf-md-file_document"      :face nerd-icons-lred)
    801     (calibre-library-mode              nerd-icons-codicon  "nf-cod-library"           :face nerd-icons-dblue)
    802     (calibre-edit-mode                 nerd-icons-codicon  "nf-cod-library"           :face nerd-icons-lred)
    803     (calibredb-search-mode             nerd-icons-codicon  "nf-cod-library"           :face nerd-icons-dblue)
    804     (calibredb-show-mode               nerd-icons-codicon  "nf-cod-library"           :face nerd-icons-lblue)
    805     (osm-mode                          nerd-icons-mdicon   "nf-md-map_search"         :face nerd-icons-lgreen)
    806     (spacemacs-buffer-mode             nerd-icons-sucicon  "nf-custom-emacs"          :face nerd-icons-purple)
    807 
    808     (elfeed-search-mode                nerd-icons-faicon   "nf-fa-rss_square"         :face nerd-icons-orange)
    809     (elfeed-summary-mode               nerd-icons-faicon   "nf-fa-rss_square"         :face nerd-icons-orange)
    810     (elfeed-show-mode                  nerd-icons-faicon   "nf-fa-rss_square"         :face nerd-icons-yellow)
    811     (newsticker-treeview-mode          nerd-icons-faicon   "nf-fa-rss_square"         :face nerd-icons-orange)
    812     (newsticker-treeview-list-mode     nerd-icons-faicon   "nf-fa-rss_square"         :face nerd-icons-lorange)
    813     (newsticker-treeview-item-mode     nerd-icons-faicon   "nf-fa-rss_square"         :face nerd-icons-yellow)
    814 
    815     (emms-browser-mode                 nerd-icons-faicon   "nf-fa-music"              :face nerd-icons-silver)
    816     (emms-lyrics-mode                  nerd-icons-faicon   "nf-fa-music"              :face nerd-icons-silver)
    817     (emms-show-all-mode                nerd-icons-faicon   "nf-fa-music"              :face nerd-icons-silver)
    818     (emms-metaplaylist-mode            nerd-icons-faicon   "nf-fa-music"              :face nerd-icons-silver)
    819     (emms-tag-editor-mode              nerd-icons-faicon   "nf-fa-music"              :face nerd-icons-silver)
    820     (emms-playlist-mode                nerd-icons-faicon   "nf-fa-music"              :face nerd-icons-silver)
    821     (lilypond-mode                     nerd-icons-faicon   "nf-fa-music"              :face nerd-icons-green)
    822     (bongo-playlist-mode               nerd-icons-faicon "nf-fa-music"                :face nerd-icons-silver)
    823     (bongo-library-mode                nerd-icons-faicon "nf-fa-music"                :face nerd-icons-silver)
    824     (mingus-playlist-mode              nerd-icons-faicon "nf-fa-music"                :face nerd-icons-silver)
    825     (mingus-help-mode                  nerd-icons-faicon "nf-fa-music"                :face nerd-icons-silver)
    826     (mingus-browse-mode                nerd-icons-faicon "nf-fa-music"                :face nerd-icons-silver)
    827     (mingus-burn-mode                  nerd-icons-faicon "nf-fa-music"                :face nerd-icons-silver)
    828     (simple-mpc-mode                   nerd-icons-faicon "nf-fa-music"                :face nerd-icons-silver)
    829     (telega-root-mode                  nerd-icons-faicon "nf-fae-telegram"            :face nerd-icons-purple)
    830     (telega-chat-mode                  nerd-icons-faicon "nf-fae-telegram"            :face nerd-icons-blue)
    831     (mastodon-mode                     nerd-icons-mdicon "nf-md-mastodon"             :face nerd-icons-blue)
    832 
    833     (fanyi-mode                        nerd-icons-codicon "nf-cod-library"            :face nerd-icons-lcyan)
    834     (osx-dictionary-mode               nerd-icons-codicon "nf-cod-library"            :face nerd-icons-lcyan)
    835     (youdao-dictionary-mode            nerd-icons-codicon "nf-cod-library"            :face nerd-icons-lcyan)
    836 
    837     (magik-mode                        nerd-icons-faicon "nf-fa-magic"                :face nerd-icons-blue)
    838     (magik-ts-mode                     nerd-icons-faicon "nf-fa-magic"                :face nerd-icons-blue)
    839     (magik-session-mode                nerd-icons-devicon "nf-dev-terminal"           :face nerd-icons-blue)
    840     (magik-cb-mode                     nerd-icons-faicon "nf-fa-book"                 :face nerd-icons-blue)
    841     ;; (meson-mode                     nerd-icons-fileicon "meson"                    :face nerd-icons-purple)
    842     ;; (man-common                     nerd-icons-fileicon "man-page"                 :face nerd-icons-blue)
    843     (heex-mode                         nerd-icons-sucicon "nf-seti-elixir"            :face nerd-icons-lorange)
    844     (heex-ts-mode                      nerd-icons-sucicon "nf-seti-elixir"            :face nerd-icons-lorange)
    845     (julia-mode                        nerd-icons-sucicon "nf-seti-julia"             :face nerd-icons-purple)
    846     (julia-ts-mode                     nerd-icons-sucicon "nf-seti-julia"             :face nerd-icons-purple)
    847     (flycheck-error-list               nerd-icons-faicon "nf-fa-list_alt"             :face nerd-icons-lred)))
    848 
    849 (defvar nerd-icons-url-alist
    850   '(
    851     ;; Social media and communities
    852     ("^\\(https?://\\)?\\(www\\.\\)?del\\.icio\\.us"          nerd-icons-faicon "nf-fa-delicious")
    853     ("^\\(https?://\\)?\\(www\\.\\)?behance\\.net"            nerd-icons-faicon "nf-fa-behance")
    854     ("^\\(https?://\\)?\\(www\\.\\)?dribbble\\.com"           nerd-icons-faicon "nf-fa-dribbble")
    855     ("^\\(https?://\\)?\\(www\\.\\)?facebook\\.com"           nerd-icons-faicon "nf-fa-facebook_official")
    856     ("^\\(https?://\\)?\\(www\\.\\)?glide\\.me"               nerd-icons-faicon "nf-fa-glide_g")
    857     ("^\\(https?://\\)?\\(www\\.\\)?plus\\.google\\.com"      nerd-icons-faicon "nf-fa-google_plus")
    858     ("linkedin\\.com"                                         nerd-icons-faicon "nf-fa-linkedin")
    859     ("^\\(https?://\\)?\\(www\\.\\)?ok\\.ru"                  nerd-icons-faicon "nf-fa-odnoklassniki")
    860     ("^\\(https?://\\)?\\(www\\.\\)?reddit\\.com"             nerd-icons-faicon "nf-fa-reddit_alien")
    861     ("^\\(https?://\\)?\\(www\\.\\)?slack\\.com"              nerd-icons-faicon "nf-fa-slack")
    862     ("^\\(https?://\\)?\\(www\\.\\)?snapchat\\.com"           nerd-icons-faicon "nf-fa-snapchat_ghost")
    863     ("^\\(https?://\\)?\\(www\\.\\)?weibo\\.com"              nerd-icons-faicon "nf-fa-weibo")
    864     ("^\\(https?://\\)?\\(www\\.\\)?twitter\\.com"            nerd-icons-faicon "nf-fa-twitter")
    865     ;; Blogging
    866     ("joomla\\.org"                                           nerd-icons-faicon "nf-fa-joomla")
    867     ("^\\(https?://\\)?\\(www\\.\\)?medium\\.com"             nerd-icons-faicon "nf-fa-medium")
    868     ("tumblr\\.com"                                           nerd-icons-faicon "nf-fa-tumblr")
    869     ("^wordpress\\.com"                                       nerd-icons-faicon "nf-fa-wordpress")
    870     ;; Programming
    871     ("^\\(https?://\\)?\\(www\\.\\)?bitbucket\\.org"          nerd-icons-faicon "nf-fa-bitbucket")
    872     ("^\\(https?://\\)?\\(www\\.\\)?codepen\\.io"             nerd-icons-faicon "nf-fa-codepen")
    873     ("^\\(https?://\\)?\\(www\\.\\)?codiepie\\.com"           nerd-icons-faicon "nf-fa-codiepie")
    874     ("^\\(https?://\\)?\\(www\\.\\)?gist\\.github\\.com"      nerd-icons-octicon "nf-oct-logo_gist")
    875     ("^\\(https?://\\)?\\(www\\.\\)?github\\.com"             nerd-icons-octicon "nf-oct-mark_github")
    876     ("^\\(https?://\\)?\\(www\\.\\)?gitlab\\.com"             nerd-icons-faicon "nf-fa-gitlab")
    877     ("^\\(https?://\\)?\\(www\\.\\)?news\\.ycombinator\\.com" nerd-icons-faicon "nf-fa-hacker_news")
    878     ("^\\(https?://\\)?\\(www\\.\\)?jsfiddle\\.net"           nerd-icons-faicon "nf-fa-jsfiddle")
    879     ("^\\(https?://\\)?\\(www\\.\\)?maxcdn\\.com"             nerd-icons-faicon "nf-fa-maxcdn")
    880     ("^\\(https?://\\)?\\(www\\.\\)?stackoverflow\\.com"      nerd-icons-faicon "nf-fa-stack_overflow")
    881     ;; Video
    882     ("^\\(https?://\\)?\\(www\\.\\)?twitch\\.tv"              nerd-icons-faicon "nf-fa-twitch")
    883     ("^\\(https?://\\)?\\(www\\.\\)?vimeo\\.com"              nerd-icons-faicon "nf-fa-vimeo")
    884     ("^\\(https?://\\)?\\(www\\.\\)?youtube\\.com"            nerd-icons-faicon "nf-fa-youtube")
    885     ("^\\(https?://\\)?\\(www\\.\\)?youtu\\.be"               nerd-icons-faicon "nf-fa-youtube")
    886     ("^\\(https?://\\)?\\(www\\.\\)?vine\\.co"                nerd-icons-faicon "nf-fa-vine")
    887     ;; Sound
    888     ("^\\(https?://\\)?\\(www\\.\\)?last\\.fm"                nerd-icons-faicon "nf-fa-lastfm")
    889     ("^\\(https?://\\)?\\(www\\.\\)?mixcloud\\.com"           nerd-icons-faicon "nf-fa-mixcloud")
    890     ("^\\(https?://\\)?\\(www\\.\\)?soundcloud\\.com"         nerd-icons-faicon "nf-fa-soundcloud")
    891     ("spotify\\.com"                                          nerd-icons-faicon "nf-fa-spotify")
    892     ;; Shopping
    893     ("^\\(https?://\\)?\\(www\\.\\)?amazon\\."                nerd-icons-faicon "nf-fa-amazon")
    894     ("^\\(https?://\\)?\\(www\\.\\)?opencart\\.com"           nerd-icons-faicon "nf-fa-opencart")
    895     ("^\\(https?://\\)?\\(www\\.\\)?paypal\\.com"             nerd-icons-faicon "nf-fa-paypal")
    896     ("^\\(https?://\\)?\\(www\\.\\)?shirtsinbulk\\.com"       nerd-icons-faicon "nf-fa-shitsinbulk")
    897     ;; Images
    898     ("^\\(https?://\\)?\\(www\\.\\)?500px\\.com"              nerd-icons-faicon "nf-fa-500px")
    899     ("^\\(https?://\\)?\\(www\\.\\)?deviantart\\.com"         nerd-icons-faicon "nf-fa-deviantart")
    900     ("^\\(https?://\\)?\\(www\\.\\)?flickr\\.com"             nerd-icons-faicon "nf-fa-flickr")
    901     ("^\\(https?://\\)?\\(www\\.\\)?instagram\\.com"          nerd-icons-faicon "nf-fa-instagram")
    902     ("^\\(https?://\\)?\\(www\\.\\)?pinterest\\."             nerd-icons-faicon "nf-fa-pinterest")
    903     ;; Information and books
    904     ("^\\(https?://\\)?\\(www\\.\\)?digg\\.com"               nerd-icons-faicon "nf-fa-digg")
    905     ("^\\(https?://\\)?\\(www\\.\\)?foursquare\\.com"         nerd-icons-faicon "nf-fa-foursquare")
    906     ("^\\(https?://\\)?\\(www\\.\\)?getpocket\\.com"          nerd-icons-faicon "nf-fa-get_pocket")
    907     ("^\\(https?://\\)?\\(www\\.\\)?scribd\\.com"             nerd-icons-faicon "nf-fa-scribd")
    908     ("^\\(https?://\\)?\\(www\\.\\)?slideshare\\.net"         nerd-icons-faicon "nf-fa-slideshare")
    909     ("stackexchange\\.com"                                    nerd-icons-faicon "nf-fa-stack_exchange")
    910     ("^\\(https?://\\)?\\(www\\.\\)?stumbleupon\\.com"        nerd-icons-faicon "nf-fa-stumbleupon")
    911     ("^\\(https?://\\)?\\(www\\.\\)?tripadvisor\\."           nerd-icons-faicon "nf-fa-tripadvisor")
    912     ("^\\(https?://\\)?\\(www\\.\\)?yelp\\."                  nerd-icons-faicon "nf-fa-yelp")
    913 
    914     ("wikipedia\\.org"                                        nerd-icons-faicon "nf-fa-wikipedia_w")
    915     ;; Various companies and tools
    916     ("^\\(https?://\\)?\\(www\\.\\)?angel\\.co"               nerd-icons-faicon "nf-fa-angellist")
    917     ("^\\(https?://\\)?\\(www\\.\\)?apple\\.com"              nerd-icons-faicon "nf-fa-apple")
    918     ("^\\(https?://\\)?\\(www\\.\\)?buysellads\\.com"         nerd-icons-faicon "nf-fa-buysellads")
    919     ("^\\(https?://\\)?\\(www\\.\\)?connectdevelop\\.com"     nerd-icons-faicon "nf-fa-connectdevelop")
    920     ("^\\(https?://\\)?\\(www\\.\\)?dashcube\\.com"           nerd-icons-faicon "nf-fa-dashcube")
    921     ("^\\(https?://\\)?\\(www\\.\\)?dropbox\\.com"            nerd-icons-faicon "nf-fa-dropbox")
    922     ("^\\(https?://\\)?\\(www\\.\\)?enviragallery\\.com"      nerd-icons-faicon "nf-fa-envira")
    923     ("^\\(https?://\\)?\\(www\\.\\)?fortawesome\\.com"        nerd-icons-faicon "nf-fa-fort_awesome")
    924     ("^\\(https?://\\)?\\(www\\.\\)?forumbee\\.com"           nerd-icons-faicon "nf-fa-forumbee")
    925     ("^\\(https?://\\)?\\(www\\.\\)?gratipay\\.com"           nerd-icons-faicon "nf-fa-gratipay")
    926     ("^\\(https?://\\)?\\(www\\.\\)?modx\\.com"               nerd-icons-faicon "nf-fa-modx")
    927     ("^\\(https?://\\)?\\(www\\.\\)?pagelines\\.com"          nerd-icons-faicon "nf-fa-pagelines")
    928     ("^\\(https?://\\)?\\(www\\.\\)?producthunt\\.com"        nerd-icons-faicon "nf-fa-product_hunt")
    929     ("sellsy\\.com"                                           nerd-icons-faicon "nf-fa-sellsy")
    930     ("^\\(https?://\\)?\\(www\\.\\)?simplybuilt\\.com"        nerd-icons-faicon "nf-fa-simplybuilt")
    931     ("^\\(https?://\\)?\\(www\\.\\)?skyatlas\\.com"           nerd-icons-faicon "nf-fa-skyatlas")
    932     ("^\\(https?://\\)?\\(www\\.\\)?skype\\.com"              nerd-icons-faicon "nf-fa-skype")
    933     ("steampowered\\.com"                                     nerd-icons-faicon "nf-fa-steam")
    934     ("^\\(https?://\\)?\\(www\\.\\)?themeisle\\.com"          nerd-icons-faicon "nf-fa-themeisle")
    935     ("^\\(https?://\\)?\\(www\\.\\)?trello\\.com"             nerd-icons-faicon "nf-fa-trello")
    936     ("^\\(https?://\\)?\\(www\\.\\)?whatsapp\\.com"           nerd-icons-faicon "nf-fa-whatsapp")
    937     ("^\\(https?://\\)?\\(www\\.\\)?ycombinator\\.com"        nerd-icons-faicon "nf-fa-y_combinator")
    938     ("yahoo\\.com"                                            nerd-icons-faicon "nf-fa-yahoo")
    939     ("^\\(https?://\\)?\\(www\\.\\)?yoast\\.com"              nerd-icons-faicon "nf-fa-yoast")
    940     ;; Catch all
    941     ("android"                                                nerd-icons-faicon "nf-fa-android")
    942     ("creativecommons"                                        nerd-icons-faicon "nf-fa-creative_commons")
    943     ("forums?"                                                nerd-icons-codicon "nf-cod-comment_discussion")
    944     ("\\.pdf$"                                                nerd-icons-codicon "nf-cod-file_pdf" :face nerd-icons-dred)
    945     ("google"                                                 nerd-icons-faicon "nf-fa-google")
    946     ("\\.rss"                                                 nerd-icons-faicon "nf-fa-rss")))
    947 
    948 (defun nerd-icons-auto-mode-match? (&optional file)
    949   "Whether or not FILE's `major-mode' match against its `auto-mode-alist'."
    950   (let* ((file (or file (buffer-file-name) (buffer-name)))
    951          (auto-mode (nerd-icons-match-to-alist file auto-mode-alist)))
    952     (eq major-mode auto-mode)))
    953 
    954 (defun nerd-icons-match-to-alist (file alist)
    955   "Match FILE against an entry in ALIST using `string-match'."
    956   (cdr (cl-find-if (lambda (it) (string-match (car it) file)) alist)))
    957 
    958 (defun nerd-icons-dir-is-submodule (dir)
    959   "Checker whether or not DIR is a git submodule."
    960   (let* ((gitmodule-dir (locate-dominating-file dir ".gitmodules"))
    961          (modules-file  (expand-file-name (format "%s.gitmodules" gitmodule-dir)))
    962          (module-search (format "submodule \".*?%s\"" (file-name-base dir))))
    963 
    964     (when (and gitmodule-dir (file-exists-p (format "%s/.git" dir)))
    965       (with-temp-buffer
    966         (insert-file-contents modules-file)
    967         (search-forward-regexp module-search (point-max) t)))))
    968 
    969 (defun nerd-icons--read-candidates ()
    970   "Helper to build a list of candidates for all glyph sets."
    971   (cl-reduce 'append (mapcar (lambda (it) (nerd-icons--read-candidates-for-glyph-set it t)) nerd-icons-glyph-sets)))
    972 
    973 (defun nerd-icons--read-candidates-for-glyph-set (glyph-set &optional show-glyph-set)
    974   "Helper to build read candidates for GLYPH-SET.
    975 
    976 If SHOW-GLYPH-SET is non-nil, displays the icons glyph set in the candidate
    977 string."
    978   (let ((data   (funcall (nerd-icons--data-name glyph-set)))
    979         (icon-f (nerd-icons--function-name glyph-set)))
    980     (mapcar
    981      (lambda (it)
    982        (let* ((icon-name (car it))
    983 
    984               (icon-display (funcall icon-f icon-name))
    985               (icon-glyph-set (if show-glyph-set (format "\t[%s]" glyph-set) ""))
    986 
    987               (candidate-name (format "%s\t%s%s" icon-display icon-name icon-glyph-set))
    988               (candidate-icon (funcall (nerd-icons--function-name glyph-set) icon-name)))
    989          (cons candidate-name candidate-icon)))
    990      data)))
    991 
    992 ;;;###autoload
    993 (defun nerd-icons-install-fonts (&optional pfx)
    994   "Helper function to download and install the latests fonts based on OS.
    995 The provided Nerd Font is Symbols Nerd Font Mono.
    996 When PFX is non-nil, ignore the prompt and just install"
    997   (interactive "P")
    998   (when (or pfx (yes-or-no-p "This will download and install fonts, are you sure you want to do this?"))
    999     (let* ((url-format "https://raw.githubusercontent.com/rainstormstudio/nerd-icons.el/main/fonts/%s")
   1000            (font-dest (cond
   1001                        ;; Default Linux install directories
   1002                        ((member system-type '(gnu gnu/linux gnu/kfreebsd))
   1003                         (concat (or (getenv "XDG_DATA_HOME")
   1004                                     (concat (getenv "HOME") "/.local/share"))
   1005                                 "/fonts/"
   1006                                 nerd-icons-fonts-subdirectory))
   1007                        ;; Default MacOS install directory
   1008                        ((eq system-type 'darwin)
   1009                         (concat (getenv "HOME")
   1010                                 "/Library/Fonts/"
   1011                                 nerd-icons-fonts-subdirectory))))
   1012            (known-dest? (stringp font-dest))
   1013            (font-dest (or font-dest (read-directory-name "Font installation directory: " "~/"))))
   1014 
   1015       (unless (file-directory-p font-dest) (mkdir font-dest t))
   1016 
   1017       (mapc (lambda (font)
   1018               (url-copy-file (format url-format font) (expand-file-name font font-dest) t))
   1019             nerd-icons-font-names)
   1020       (when known-dest?
   1021         (message "Fonts downloaded, updating font cache... <fc-cache -f -v> ")
   1022         (shell-command-to-string (format "fc-cache -f -v")))
   1023       (message "%s Successfully %s `nerd-icons' fonts to `%s'!"
   1024                (nerd-icons-wicon "nf-weather-stars" :v-adjust 0.0)
   1025                (if known-dest? "installed" "downloaded")
   1026                font-dest))))
   1027 
   1028 ;;;###autoload
   1029 (defun nerd-icons-insert (&optional arg glyph-set)
   1030   "Interactive icon insertion function.
   1031 When Prefix ARG is non-nil, insert the propertized icon.
   1032 When GLYPH-SET is non-nil, limit the candidates to the icon set matching it."
   1033   (interactive "P")
   1034   (let* ((standard-output (current-buffer))
   1035          (candidates (if glyph-set
   1036                          (nerd-icons--read-candidates-for-glyph-set glyph-set)
   1037                        (nerd-icons--read-candidates)))
   1038          (prompt     (if glyph-set
   1039                          (format "%s Icon: " (funcall (nerd-icons--glyph-set-name glyph-set)))
   1040                        "Icon : "))
   1041          (selection (completing-read prompt candidates nil t))
   1042          (result    (cdr (assoc selection candidates))))
   1043 
   1044     (if arg (prin1 result) (insert result))))
   1045 
   1046 ;;;###autoload
   1047 (defun nerd-icons-icon-for-dir (dir &rest arg-overrides)
   1048   "Get the formatted icon for DIR.
   1049 ARG-OVERRIDES should be a plist containining `:height',
   1050 `:v-adjust' or `:face' properties like in the normal icon
   1051 inserting functions."
   1052   (let* ((dir (or dir default-directory "/"))
   1053          (dirname (file-name-base (directory-file-name dir)))
   1054          (path (if (file-name-absolute-p dir) dir (expand-file-name dir)))
   1055          (icon (nerd-icons-match-to-alist dirname nerd-icons-dir-icon-alist))
   1056          (args (cdr icon)))
   1057     (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
   1058     (cond
   1059      ((file-remote-p path)
   1060       (apply #'nerd-icons-codicon "nf-cod-remote" (cdr args)))
   1061      ((file-symlink-p path)
   1062       (apply #'nerd-icons-codicon "nf-cod-file_symlink_directory" (cdr args)))
   1063      ((nerd-icons-dir-is-submodule path)
   1064       (apply #'nerd-icons-codicon "nf-cod-file_submodule" (cdr args)))
   1065      ((file-exists-p (format "%s/.git" path))
   1066       (apply #'nerd-icons-octicon "nf-oct-repo" (cdr args)))
   1067      (t (apply (car icon) args)))))
   1068 
   1069 ;;;###autoload
   1070 (defun nerd-icons-icon-for-file (file &rest arg-overrides)
   1071   "Get the formatted icon for FILE.
   1072 ARG-OVERRIDES should be a plist containining `:height',
   1073 `:v-adjust' or `:face' properties like in the normal icon
   1074 inserting functions."
   1075   (let* ((name (file-name-nondirectory file))
   1076          (ext (file-name-extension name))
   1077          (icon (or (nerd-icons-match-to-alist name nerd-icons-regexp-icon-alist)
   1078                    (and ext
   1079                         (cdr (assoc (downcase ext)
   1080                                     nerd-icons-extension-icon-alist)))
   1081                    nerd-icons-default-file-icon))
   1082          (args (cdr icon)))
   1083     (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
   1084     (apply (car icon) args)))
   1085 
   1086 ;;;###autoload
   1087 (defun nerd-icons-icon-for-extension (ext &rest arg-overrides)
   1088   "Get the formatted icon for EXT.
   1089 ARG-OVERRIDES should be a plist containining `:height',
   1090 `:v-adjust' or `:face' properties like in the normal icon
   1091 inserting functions."
   1092   (let* ((icon (or
   1093                 (and ext
   1094                      (cdr (assoc (downcase ext)
   1095                                  nerd-icons-extension-icon-alist)))
   1096                 nerd-icons-default-file-icon))
   1097          (args (cdr icon)))
   1098     (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
   1099     (apply (car icon) args)))
   1100 
   1101 ;;;###autoload
   1102 (defun nerd-icons-icon-for-mode (mode &rest arg-overrides)
   1103   "Get the formatted icon for MODE.
   1104 ARG-OVERRIDES should be a plist containining `:height',
   1105 `:v-adjust' or `:face' properties like in the normal icon
   1106 inserting functions."
   1107   (let* ((icon (or (cdr (or (assoc mode nerd-icons-mode-icon-alist)
   1108                             (assoc (get mode 'derived-mode-parent) nerd-icons-mode-icon-alist)))
   1109                    nerd-icons-default-file-icon))
   1110          (args (cdr icon)))
   1111     (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
   1112     (if icon (apply (car icon) args) mode)))
   1113 
   1114 ;;;###autoload
   1115 (defun nerd-icons-icon-for-url (url &rest arg-overrides)
   1116   "Get the formatted icon for URL.
   1117 If an icon for URL isn't found in `nerd-icons-url-alist', a globe is used.
   1118 ARG-OVERRIDES should be a plist containining `:height',
   1119 `:v-adjust' or `:face' properties like in the normal icon
   1120 inserting functions."
   1121   (let* ((icon (nerd-icons-match-to-alist url nerd-icons-url-alist))
   1122          (args (cdr icon)))
   1123     (unless icon
   1124       (setq icon '(nerd-icons-faicon "nf-fa-globe"))
   1125       (setq args (cdr icon)))
   1126     (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
   1127     (apply (car icon) args)))
   1128 
   1129 ;;;###autoload
   1130 (defun nerd-icons-icon-for-buffer ()
   1131   "Get the formatted icon for the current buffer.
   1132 
   1133 This function prioritises the use of the buffers file extension to
   1134 discern the icon when its `major-mode' matches its auto mode,
   1135 otherwise it will use the buffers `major-mode' to decide its
   1136 icon."
   1137   (nerd-icons--icon-info-for-buffer))
   1138 
   1139 (defun nerd-icons-cache (func)
   1140   "Set a cache for FUNC.  Does not work on interactive functions."
   1141   (unless (get func 'nerd-icons--cached)
   1142     (let ((cache (make-hash-table :test #'equal
   1143                                   :size nerd-icons--cache-limit))
   1144           (orig-fn (symbol-function func)))
   1145       (fset func
   1146             (lambda (&rest args)
   1147               (or (gethash args cache)
   1148                   (progn
   1149                     (when (> (hash-table-count cache)
   1150                              nerd-icons--cache-limit)
   1151                       (clrhash cache))
   1152                     (puthash args (apply orig-fn args) cache)))))))
   1153 
   1154   (put func 'nerd-icons--cached t))
   1155 
   1156 (nerd-icons-cache #'nerd-icons-icon-for-dir)
   1157 (nerd-icons-cache #'nerd-icons-icon-for-file)
   1158 (nerd-icons-cache #'nerd-icons-icon-for-extension)
   1159 (nerd-icons-cache #'nerd-icons-icon-for-mode)
   1160 (nerd-icons-cache #'nerd-icons-icon-for-url)
   1161 
   1162 (defun nerd-icons--icon-info-for-buffer (&optional f)
   1163   "Get icon info for the current buffer.
   1164 When F is provided, the info function is calculated with the format
   1165 `nerd-icons-icon-%s-for-file' or `nerd-icons-icon-%s-for-mode'."
   1166   (let* ((base-f (concat "nerd-icons-icon" (when f (format "-%s" f))))
   1167          (file-f (intern (concat base-f "-for-file")))
   1168          (mode-f (intern (concat base-f "-for-mode"))))
   1169     (if (and (buffer-file-name)
   1170              (nerd-icons-auto-mode-match?))
   1171         (funcall file-f (file-name-nondirectory (buffer-file-name)))
   1172       (funcall mode-f major-mode))))
   1173 
   1174 ;; Weather icons
   1175 (defun nerd-icons-icon-for-weather (weather)
   1176   "Get an icon for a WEATHER status."
   1177   (let ((icon (nerd-icons-match-to-alist weather nerd-icons-weather-icon-alist)))
   1178     (if icon (apply (car icon) (cdr icon)) weather)))
   1179 
   1180 ;; For `web-mode'
   1181 (defun nerd-icons--web-mode-icon (&rest arg-overrides)
   1182   "Get icon for a `web-mode' buffer with ARG-OVERRIDES."
   1183   (nerd-icons--web-mode arg-overrides))
   1184 (defun nerd-icons--web-mode-icon-family ()
   1185   "Get icon family for a `web-mode' buffer."
   1186   (nerd-icons--web-mode t))
   1187 
   1188 (defvar web-mode-content-type)          ; external
   1189 (defun nerd-icons--web-mode (&optional arg-overrides)
   1190   "Return icon or FAMILY for `web-mode' based on `web-mode-content-type'.
   1191 Providing ARG-OVERRIDES will modify the creation of the icon."
   1192   (let ((non-nil-args (cl-reduce (lambda (acc it) (if it (append acc (list it)) acc))
   1193                                  arg-overrides :initial-value '())))
   1194     (cond
   1195      ((equal web-mode-content-type "jsx")
   1196       (apply 'nerd-icons-devicon (append '("javascript") non-nil-args)))
   1197      ((equal web-mode-content-type "javascript")
   1198       (apply 'nerd-icons-devicon (append '("javascript") non-nil-args)))
   1199      ((equal web-mode-content-type "json")
   1200       (apply 'nerd-icons-devicon (append '("nf-dev-less") non-nil-args)))
   1201      ((equal web-mode-content-type "xml")
   1202       (apply 'nerd-icons-faicon (append '("nf-fa-file_code_o") non-nil-args)))
   1203      ((equal web-mode-content-type "css")
   1204       (apply 'nerd-icons-devicon (append '("nf-dev-css3") non-nil-args)))
   1205      (t
   1206       (apply 'nerd-icons-devicon (append '("nf-dev-html5") non-nil-args))))))
   1207 
   1208 (eval-and-compile
   1209   (defun nerd-icons--function-name (name)
   1210     "Get the symbol for an icon function name for icon set NAME."
   1211     (intern (concat "nerd-icons-" (downcase (symbol-name name)))))
   1212 
   1213   (defun nerd-icons--family-name (name)
   1214     "Get the symbol for an icon family function for icon set NAME."
   1215     (intern (concat "nerd-icons-" (downcase (symbol-name name)) "-family")))
   1216 
   1217   (defun nerd-icons--glyph-set-name (name)
   1218     "Get the symbol for an icon glyph set function for icon set NAME."
   1219     (intern (concat "nerd-icons-" (downcase (symbol-name name)) "-glyph-set")))
   1220 
   1221   (defun nerd-icons--data-name (name)
   1222     "Get the symbol for an icon family function for icon set NAME."
   1223     (intern (concat "nerd-icons-" (downcase (symbol-name name)) "-data")))
   1224 
   1225   (defun nerd-icons--insert-function-name (name)
   1226     "Get the symbol for an icon insert function for icon set NAME."
   1227     (intern (concat "nerd-icons-insert-" (downcase (symbol-name name))))))
   1228 
   1229 (defun nerd-icons-insert-icons-for (family &optional height duration)
   1230   "Insert all of the available icons associated with FAMILY.
   1231 If a HEIGHT is provided it will render the icons at this height.
   1232 This is useful both to see the icons more clearly and to test
   1233 different height rendering.  If DURATION is provided, it will
   1234 pause for DURATION seconds between printing each character."
   1235   (let* ((data-f    (nerd-icons--data-name family))
   1236          (insert-f  (nerd-icons--function-name family))
   1237 
   1238          (height (or height 1.0))
   1239          (data (funcall data-f)))
   1240     (mapc
   1241      (lambda (it)
   1242        (insert (format "%s - %s\n" (funcall insert-f (car it) :height height) (car it)))
   1243        (when duration (sit-for duration)))
   1244      data)))
   1245 
   1246 (defun nerd-icons-set-font (&optional font-family frame)
   1247   "Modify nerd font charsets to use FONT-FAMILY for FRAME."
   1248   (let ((font-f (or font-family nerd-icons-font-family))
   1249         (charsets '((#xe5fa . #xe6b2)  ;; Seti-UI + Custom
   1250                     (#xe700 . #xe7c5)  ;; Devicons
   1251                     (#xf000 . #xf2e0)  ;; Font Awesome
   1252                     (#xe200 . #xe2a9)  ;; Font Awesome Extension
   1253                     (#xf500 . #xfd46) (#xf0001 . #xf1af0) ;; Material Design Icons
   1254                     (#xe300 . #xe3eb)  ;; Weather
   1255                     (#xf400 . #xf4a8) #x2665 #x26a1 #xf27c  ;; Octicons
   1256                     (#xe0a0 . #xe0a2) (#xe0b0 . #xe0b3)  ;; Powerline Symbols
   1257                     #xe0a3 (#xe0b4 . #xe0c8) (#xe0cc . #xe0d2) #xe0d4  ;; Powerline Extra Symbols
   1258                     (#x23fb . #x23fe) #x2b58  ;; IEC Power Symbols
   1259                     (#xf300 . #xf372)  ;; Font Logos
   1260                     (#xe000 . #xe00a)  ;; Pomicons
   1261                     (#xea60 . #xebeb))))  ;; Codicons
   1262     (cl-loop for charset in charsets do
   1263              (set-fontset-font
   1264               (frame-parameter nil 'font)
   1265               charset
   1266               (font-spec :family font-f
   1267                          :weight nil
   1268                          :size   nil)
   1269               frame
   1270               'prepend))))
   1271 
   1272 (defmacro nerd-icons-define-icon (name alist family glyph-set)
   1273   "Macro to generate functions for inserting icons for icon set NAME.
   1274 
   1275 NAME defines is the name of the iconset and will produce a
   1276 function of the for `nerd-icon-NAME'.
   1277 
   1278 ALIST is the alist containing maps between icon names and the
   1279 UniCode for the character.  All of these can be found in the data
   1280 directory of this package.
   1281 
   1282 FAMILY is the font family to use for the icons.
   1283 GLYPH-SET is the glyph set of the icon."
   1284   `(progn
   1285      (add-to-list 'nerd-icons-glyph-sets (quote ,name))
   1286      (defun ,(nerd-icons--family-name name) () ,family)
   1287      (defun ,(nerd-icons--glyph-set-name name) () ,glyph-set)
   1288      (defun ,(nerd-icons--data-name name) () ,alist)
   1289      (defun ,(nerd-icons--function-name name) (icon-name &rest args)
   1290        (let ((icon (cdr (assoc icon-name ,alist)))
   1291              (other-face (when nerd-icons-color-icons (plist-get args :face)))
   1292              (height (* nerd-icons-scale-factor (or (plist-get args :height) 1.0)))
   1293              (v-adjust (* nerd-icons-scale-factor (or (plist-get args :v-adjust) nerd-icons-default-adjust)))
   1294              (family ,family))
   1295          (unless icon
   1296            (error "Unable to find icon with name `%s' in icon set `%s'" icon-name (quote ,name)))
   1297          (let ((face (if other-face
   1298                          `(:family ,family :height ,height :inherit ,other-face)
   1299                        `(:family ,family :height ,height))))
   1300            (propertize icon
   1301                        'face face
   1302                        'font-lock-face face
   1303                        'display `(raise ,v-adjust)
   1304                        'rear-nonsticky t))))
   1305      (defun ,(nerd-icons--insert-function-name name) (&optional arg)
   1306        ,(format "Insert a %s icon at point." glyph-set)
   1307        (interactive "P")
   1308        (nerd-icons-insert arg (quote ,name)))))
   1309 
   1310 (nerd-icons-define-icon ipsicon nerd-icons/ipsicon-alist nerd-icons-font-family "IEC Power Symbols")
   1311 (nerd-icons-define-icon octicon nerd-icons/octicon-alist nerd-icons-font-family "Octicons")
   1312 (nerd-icons-define-icon pomicon nerd-icons/pomicon-alist nerd-icons-font-family "Pomicons")
   1313 (nerd-icons-define-icon powerline nerd-icons/powerline-alist nerd-icons-font-family "Powerline Symbols")
   1314 (nerd-icons-define-icon faicon nerd-icons/faicon-alist nerd-icons-font-family "Font Awesome")
   1315 (nerd-icons-define-icon wicon nerd-icons/wicon-alist nerd-icons-font-family "Weather")
   1316 (nerd-icons-define-icon sucicon nerd-icons/sucicon-alist nerd-icons-font-family "Seti-UI + Custom")
   1317 (nerd-icons-define-icon devicon nerd-icons/devicon-alist nerd-icons-font-family "Devicons")
   1318 (nerd-icons-define-icon codicon nerd-icons/codicon-alist nerd-icons-font-family "Codicons")
   1319 (nerd-icons-define-icon flicon nerd-icons/flicon-alist nerd-icons-font-family "Font Logos")
   1320 (nerd-icons-define-icon mdicon nerd-icons/mdicon-alist nerd-icons-font-family "Material Design Icons")
   1321 
   1322 (provide 'nerd-icons)
   1323 ;;; nerd-icons.el ends here