config

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

nerd-icons.el (91801B)


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