config

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

nerd-icons.el (92758B)


      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     ;; Godot / GDScript
    337     ("gd"             nerd-icons-sucicon "nf-seti-godot"         :face nerd-icons-blue)
    338     ("tscn"           nerd-icons-codicon "nf-cod-settings"       :face nerd-icons-orange)
    339     ("tres"           nerd-icons-codicon "nf-cod-settings"       :face nerd-icons-orange)
    340     ;; zig
    341     ("zig"            nerd-icons-sucicon "nf-seti-zig"           :face nerd-icons-orange)
    342     ;; odin
    343     ;; ("odin"        nerd-icons-fileicon "odin") TODO: odin
    344     ;; File Types
    345     ("ico"            nerd-icons-octicon "nf-oct-file_media"     :face nerd-icons-blue)
    346     ("png"            nerd-icons-mdicon "nf-md-file_png_box"     :face nerd-icons-orange)
    347     ("gif"            nerd-icons-mdicon "nf-md-file_gif_box"     :face nerd-icons-green)
    348     ("jpeg"           nerd-icons-mdicon "nf-md-file_jpg_box"     :face nerd-icons-dblue)
    349     ("jpg"            nerd-icons-mdicon "nf-md-file_jpg_box"     :face nerd-icons-dblue)
    350     ("webp"           nerd-icons-octicon "nf-oct-file_media"     :face nerd-icons-dblue)
    351     ("xpm"            nerd-icons-octicon "nf-oct-file_media"     :face nerd-icons-dgreen)
    352     ;; Audio
    353     ("mp3"            nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    354     ("wav"            nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    355     ("m4a"            nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    356     ("ogg"            nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    357     ("flac"           nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    358     ("opus"           nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    359     ("au"             nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    360     ("aif"            nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    361     ("aifc"           nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    362     ("aiff"           nerd-icons-faicon "nf-fa-music"            :face nerd-icons-dred)
    363     ("svg"            nerd-icons-sucicon "nf-seti-svg"           :face nerd-icons-lgreen)
    364     ;; Video
    365     ("mov"            nerd-icons-faicon "nf-fa-film"             :face nerd-icons-blue)
    366     ("mp4"            nerd-icons-faicon "nf-fa-film"             :face nerd-icons-blue)
    367     ("ogv"            nerd-icons-faicon "nf-fa-film"             :face nerd-icons-dblue)
    368     ("mpg"            nerd-icons-faicon "nf-fa-film"             :face nerd-icons-blue)
    369     ("mpeg"           nerd-icons-faicon "nf-fa-film"             :face nerd-icons-blue)
    370     ("flv"            nerd-icons-faicon "nf-fa-film"             :face nerd-icons-blue)
    371     ("ogv"            nerd-icons-faicon "nf-fa-film"             :face nerd-icons-dblue)
    372     ("mkv"            nerd-icons-faicon "nf-fa-film"             :face nerd-icons-blue)
    373     ("webm"           nerd-icons-faicon "nf-fa-film"             :face nerd-icons-blue)
    374     ;; Fonts
    375     ("ttf"            nerd-icons-faicon "nf-fa-font"             :face nerd-icons-dcyan)
    376     ("woff"           nerd-icons-faicon "nf-fa-font"             :face nerd-icons-cyan)
    377     ("woff2"          nerd-icons-faicon "nf-fa-font"             :face nerd-icons-cyan)
    378     ;; Archives
    379     ("iso"            nerd-icons-mdicon "nf-md-disc"            :face nerd-icons-orange)
    380     ("tar"            nerd-icons-mdicon "nf-md-zip_box"          :face nerd-icons-orange)
    381     ("rar"            nerd-icons-mdicon "nf-md-zip_box"          :face nerd-icons-orange)
    382     ("tgz"            nerd-icons-mdicon "nf-md-zip_box"          :face nerd-icons-orange)
    383     ("jar"            nerd-icons-devicon "nf-dev-java"           :face nerd-icons-dpurple)
    384     ;; Doc
    385     ("pdf"            nerd-icons-codicon "nf-cod-file_pdf"       :face nerd-icons-dred)
    386     ("text"           nerd-icons-faicon "nf-fa-file_text"        :face nerd-icons-cyan)
    387     ("txt"            nerd-icons-faicon "nf-fa-file_text"        :face nerd-icons-cyan)
    388     ("doc"            nerd-icons-mdicon "nf-md-file_word"        :face nerd-icons-blue)
    389     ("docx"           nerd-icons-mdicon "nf-md-file_word"        :face nerd-icons-blue)
    390     ("docm"           nerd-icons-mdicon "nf-md-file_word"        :face nerd-icons-blue)
    391     ("texi"           nerd-icons-sucicon "nf-seti-tex"           :face nerd-icons-lred)
    392     ("tex"            nerd-icons-sucicon "nf-seti-tex"           :face nerd-icons-lred)
    393     ("ltx"            nerd-icons-sucicon "nf-seti-tex"           :face nerd-icons-lred)
    394     ("dtx"            nerd-icons-sucicon "nf-seti-tex"           :face nerd-icons-lred)
    395     ("sty"            nerd-icons-sucicon "nf-seti-tex"           :face nerd-icons-lred)
    396     ("md"             nerd-icons-octicon "nf-oct-markdown"       :face nerd-icons-lblue)
    397     ("bib"            nerd-icons-mdicon "nf-md-book"             :face nerd-icons-lblue)
    398     ("org"            nerd-icons-sucicon "nf-custom-orgmode"     :face nerd-icons-lgreen)
    399     ("org_archive"    nerd-icons-sucicon "nf-custom-orgmode"     :face nerd-icons-lgreen)
    400     ("pps"            nerd-icons-mdicon "nf-md-file_powerpoint"  :face nerd-icons-orange)
    401     ("ppt"            nerd-icons-mdicon "nf-md-file_powerpoint"  :face nerd-icons-orange)
    402     ("pptx"           nerd-icons-mdicon "nf-md-file_powerpoint"  :face nerd-icons-orange)
    403     ("pptsx"          nerd-icons-mdicon "nf-md-file_powerpoint"  :face nerd-icons-orange)
    404     ("ppttx"          nerd-icons-mdicon "nf-md-file_powerpoint"  :face nerd-icons-orange)
    405     ("knt"            nerd-icons-mdicon "nf-md-file_powerpoint"  :face nerd-icons-cyan)
    406     ("xlsx"           nerd-icons-mdicon "nf-md-file_excel"       :face nerd-icons-dgreen)
    407     ("xlsm"           nerd-icons-mdicon "nf-md-file_excel"       :face nerd-icons-dgreen)
    408     ("xlsb"           nerd-icons-mdicon "nf-md-file_excel"       :face nerd-icons-dgreen)
    409     ("xltx"           nerd-icons-mdicon "nf-md-file_excel"       :face nerd-icons-dgreen)
    410     ("xltm"           nerd-icons-mdicon "nf-md-file_excel"       :face nerd-icons-dgreen)
    411     ("epub"           nerd-icons-mdicon "nf-md-book_open"        :face nerd-icons-green)
    412     ("ly"             nerd-icons-faicon "nf-fa-music"            :face nerd-icons-green)
    413     ;;
    414     ("key"            nerd-icons-octicon "nf-oct-key"            :face nerd-icons-lblue)
    415     ("pem"            nerd-icons-octicon "nf-oct-key"            :face nerd-icons-orange)
    416     ("p12"            nerd-icons-octicon "nf-oct-key"            :face nerd-icons-dorange)
    417     ("crt"            nerd-icons-octicon "nf-oct-key"            :face nerd-icons-lblue)
    418     ("pub"            nerd-icons-octicon "nf-oct-key"            :face nerd-icons-blue)
    419     ("gpg"            nerd-icons-octicon "nf-oct-key"            :face nerd-icons-lblue)
    420     ("kdbx"           nerd-icons-octicon "nf-oct-key"            :face nerd-icons-green)
    421     ("cache"          nerd-icons-octicon "nf-oct-database"       :face nerd-icons-green)
    422     ;; backup
    423     ("backup"         nerd-icons-mdicon "nf-md-file_restore"     :face nerd-icons-lblue)
    424     ("old"            nerd-icons-mdicon "nf-md-file_restore"     :face nerd-icons-lblue)
    425     ("bak"            nerd-icons-mdicon "nf-md-file_restore"     :face nerd-icons-lblue)))
    426 
    427 (defvar                        nerd-icons-regexp-icon-alist
    428   '(
    429     ;;
    430     ("^TAGS$"                  nerd-icons-octicon "nf-oct-tag"               :face nerd-icons-blue)
    431     ("^TODO$"                  nerd-icons-octicon "nf-oct-checklist"         :face nerd-icons-lyellow)
    432     ("^LICENSE$"               nerd-icons-octicon "nf-oct-book"              :face nerd-icons-blue)
    433     ("^readme"                 nerd-icons-octicon "nf-oct-book"              :face nerd-icons-lcyan)
    434 
    435     ;; Config
    436     ("nginx$"                  nerd-icons-devicon "nf-dev-nginx"             :face nerd-icons-dgreen)
    437     ;; ("apache$"              nerd-icons-alltheicon "apache") TODO: apache
    438 
    439     ;; C
    440     ("^Makefile$"              nerd-icons-sucicon "nf-seti-makefile"         :face nerd-icons-dorange)
    441     ("^CMakeLists.txt$"        nerd-icons-sucicon "nf-seti-makefile"         :face nerd-icons-red) ;; TODO: cmake
    442     ("^CMakeCache.txt$"        nerd-icons-sucicon "nf-seti-makefile"         :face nerd-icons-blue) ;; TODO: cmakecache
    443     ("^meson.build$"           nerd-icons-sucicon "nf-seti-makefile"         :face nerd-icons-purple) ;; TODO: meson
    444     ("^meson_options.txt$"     nerd-icons-sucicon "nf-seti-makefile"         :face nerd-icons-purple) ;; TODO: meson
    445 
    446     ;; Docker
    447     ("^\\.?Dockerfile"         nerd-icons-sucicon "nf-seti-docker"           :face nerd-icons-blue)
    448 
    449     ;; Homebrew
    450     ("^Brewfile$"              nerd-icons-faicon "nf-fa-beer"                :face nerd-icons-lsilver)
    451 
    452     ;; ;; AWS
    453     ("^stack.*.json$"          nerd-icons-devicon "nf-dev-aws"               :face nerd-icons-orange)
    454     ("^serverless\\.yml$"      nerd-icons-faicon "nf-fa-bolt"                :face nerd-icons-yellow)
    455 
    456     ;; lock files
    457     ("~$"                      nerd-icons-octicon "nf-oct-lock"              :face nerd-icons-maroon)
    458 
    459     ;; Source Codes
    460     ("^mix.lock$"              nerd-icons-sucicon "nf-seti-elixir"           :face nerd-icons-lyellow)
    461 
    462     ;; Ruby
    463     ("^Gemfile\\(\\.lock\\)?$" nerd-icons-octicon "nf-oct-ruby"              :face nerd-icons-red)
    464     ("_?test\\.rb$"            nerd-icons-octicon "nf-oct-ruby"              :face nerd-icons-red)
    465     ("_?test_helper\\.rb$"     nerd-icons-octicon "nf-oct-ruby"              :face nerd-icons-dred)
    466     ("_?spec\\.rb$"            nerd-icons-octicon "nf-oct-ruby"              :face nerd-icons-red)
    467     ("_?spec_helper\\.rb$"     nerd-icons-octicon "nf-oct-ruby"              :face nerd-icons-dred)
    468 
    469     ("-?spec\\.ts$"            nerd-icons-mdicon "nf-md-language_typescript" :face nerd-icons-blue)
    470     ("-?test\\.ts$"            nerd-icons-mdicon "nf-md-language_typescript" :face nerd-icons-blue)
    471     ("-?spec\\.js$"            nerd-icons-mdicon "nf-md-language_javascript" :face nerd-icons-lpurple)
    472     ("-?test\\.js$"            nerd-icons-mdicon "nf-md-language_javascript" :face nerd-icons-lpurple)
    473     ("-?spec\\.jsx$"           nerd-icons-mdicon "nf-md-react"               :face nerd-icons-blue-alt)
    474     ("-?test\\.jsx$"           nerd-icons-mdicon "nf-md-react"               :face nerd-icons-blue-alt)
    475 
    476     ;; Git
    477     ("^MERGE_"                 nerd-icons-octicon "nf-oct-git_merge"         :face nerd-icons-red)
    478     ("^COMMIT_EDITMSG"         nerd-icons-octicon "nf-oct-git_commit"        :face nerd-icons-red)
    479 
    480     ;; Stylesheeting
    481     ("^stylelint"               nerd-icons-sucicon "nf-seti-stylelint"        :face nerd-icons-lyellow)
    482 
    483     ;; JavaScript
    484     ("^package.json$"          nerd-icons-devicon "nf-dev-npm"               :face nerd-icons-red)
    485     ("^package.lock.json$"     nerd-icons-devicon "nf-dev-npm"               :face nerd-icons-dred)
    486     ("^yarn\\.lock"            nerd-icons-sucicon "nf-seti-yarn"             :face nerd-icons-blue-alt)
    487     ("\\.npmignore$"           nerd-icons-devicon "nf-dev-npm"               :face nerd-icons-dred)
    488     ("^bower.json$"            nerd-icons-devicon "nf-dev-bower"             :face nerd-icons-lorange)
    489     ("^gulpfile"               nerd-icons-devicon "nf-dev-gulp"              :face nerd-icons-lred)
    490     ("^gruntfile"              nerd-icons-devicon "nf-dev-grunt"             :face nerd-icons-lyellow)
    491     ("^webpack"                nerd-icons-mdicon "nf-md-webpack"             :face nerd-icons-lblue)
    492 
    493     ;; Go
    494     ("^go.mod$"                nerd-icons-sucicon "nf-seti-config"           :face nerd-icons-blue-alt)
    495     ("^go.work$"               nerd-icons-sucicon "nf-seti-config"           :face nerd-icons-blue-alt)
    496 
    497     ;; Groovy
    498     ("Jenkinsfile\\'"          nerd-icons-devicon "nf-dev-groovy"            :face nerd-icons-cyan-alt)
    499 
    500     ;; Emacs
    501     ("^bookmark"                nerd-icons-octicon "nf-oct-bookmark"          :face nerd-icons-lpink)
    502 
    503     ("^\\*scratch\\*$"         nerd-icons-faicon "nf-fa-sticky_note"         :face nerd-icons-lyellow)
    504     ("^\\*scratch.*"           nerd-icons-faicon "nf-fa-sticky_note"         :face nerd-icons-yellow)
    505     ("^\\*new-tab\\*$"         nerd-icons-mdicon "nf-md-star"                :face nerd-icons-cyan)
    506     ("Cask\\'"                 nerd-icons-sucicon "nf-custom-emacs"          :face nerd-icons-blue)
    507     ("Eask\\'"                 nerd-icons-sucicon "nf-custom-emacs"          :face nerd-icons-blue)
    508 
    509     ("^\\."                    nerd-icons-octicon "nf-oct-gear")))
    510 
    511 (defvar nerd-icons-default-file-icon
    512   '(nerd-icons-faicon "nf-fa-file_o"))
    513 
    514 (defvar nerd-icons-dir-icon-alist
    515   '(
    516     ("trash"            nerd-icons-faicon "nf-fa-trash_o")
    517     ("dropbox"          nerd-icons-faicon "nf-fa-dropbox")
    518     ("google[ _-]drive" nerd-icons-mdicon "nf-md-folder_google_drive")
    519     ("github"           nerd-icons-sucicon "nf-custom-folder_github")
    520     ("^atom$"           nerd-icons-devicon "nf-dev-atom")
    521     ("documents"        nerd-icons-mdicon "nf-md-folder_file")
    522     ("download"         nerd-icons-mdicon "nf-md-folder_download")
    523     ("desktop"          nerd-icons-octicon "nf-oct-device_desktop")
    524     ("pictures"         nerd-icons-mdicon "nf-md-folder_image")
    525     ("photos"           nerd-icons-faicon "nf-fa-camera_retro")
    526     ("music"            nerd-icons-mdicon "nf-md-folder_music")
    527     ("movies"           nerd-icons-faicon "nf-fa-film")
    528     ("code"             nerd-icons-octicon "nf-oct-code")
    529     ("workspace"        nerd-icons-octicon "nf-oct-code")
    530     ;; ("test"             nerd-icons-devicon "test-dir")
    531     ("\\.git"           nerd-icons-sucicon "nf-custom-folder_git")
    532     ("\\.config"        nerd-icons-sucicon "nf-custom-folder_config")
    533     (".?"               nerd-icons-sucicon "nf-custom-folder_oct")))
    534 
    535 (defvar nerd-icons-weather-icon-alist
    536   '(
    537     ("tornado"               nerd-icons-wicon "nf-weather-tornado")
    538     ("hurricane"             nerd-icons-wicon "nf-weather-hurricane")
    539     ("thunderstorms"         nerd-icons-wicon "nf-weather-thunderstorm")
    540     ("sunny"                 nerd-icons-wicon "nf-weather-day_sunny")
    541     ("rain.*snow"            nerd-icons-wicon "nf-weather-rain_mix")
    542     ("rain.*hail"            nerd-icons-wicon "nf-weather-rain_mix")
    543     ("sleet"                 nerd-icons-wicon "nf-weather-sleet")
    544     ("hail"                  nerd-icons-wicon "nf-weather-hail")
    545     ("drizzle"               nerd-icons-wicon "nf-weather-sprinkle")
    546     ("rain"                  nerd-icons-wicon "nf-weather-showers")
    547     ("showers"               nerd-icons-wicon "nf-weather-showers")
    548     ("blowing.*snow"         nerd-icons-wicon "nf-weather-snow_wind")
    549     ("snow"                  nerd-icons-wicon "nf-weather-snow")
    550     ("dust"                  nerd-icons-wicon "nf-weather-dust")
    551     ("fog"                   nerd-icons-wicon "nf-weather-fog")
    552     ("haze"                  nerd-icons-wicon "nf-weather-day_haze")
    553     ("smoky"                 nerd-icons-wicon "nf-weather-smoke")
    554     ("blustery"              nerd-icons-wicon "nf-weather-cloudy_windy")
    555     ("windy"                 nerd-icons-wicon "nf-weather-cloudy_gusts")
    556     ("cold"                  nerd-icons-wicon "nf-weather-snowflake_cold")
    557     ("partly.*cloudy.*night" nerd-icons-wicon "nf-weather-night_alt_partly_cloudy")
    558     ("partly.*cloudy"        nerd-icons-wicon "nf-weather-day_cloudy_high")
    559     ("cloudy.*night"         nerd-icons-wicon "nf-weather-night_alt_cloudy")
    560     ("cxloudy.*day"          nerd-icons-wicon "nf-weather-day_cloudy")
    561     ("cloudy"                nerd-icons-wicon "nf-weather-cloudy")
    562     ("clear.*night"          nerd-icons-wicon "nf-weather-night_clear")
    563     ("fair.*night"           nerd-icons-wicon "nf-weather-stars")
    564     ("fair.*day"             nerd-icons-wicon "nf-weather-horizon")
    565     ("hot"                   nerd-icons-wicon "nf-weather-hot")
    566     ("not.*available"        nerd-icons-wicon "nf-weather-na")))
    567 
    568 (defvar nerd-icons-mode-icon-alist
    569   '(
    570     (emacs-lisp-mode                   nerd-icons-sucicon "nf-custom-emacs"           :face nerd-icons-purple)
    571     (circe-server-mode                 nerd-icons-faicon "nf-fa-commenting_o")
    572     (circe-channel-mode                nerd-icons-faicon "nf-fa-commenting_o")
    573     (circe-query-mode                  nerd-icons-faicon "nf-fa-commenting_o")
    574     (crystal-mode                      nerd-icons-sucicon "nf-custom-crystal"         :face nerd-icons-yellow)
    575     (erc-mode                          nerd-icons-faicon "nf-fa-commenting_o")
    576     (inferior-emacs-lisp-mode          nerd-icons-sucicon "nf-custom-emacs"           :face nerd-icons-lblue)
    577     (dired-mode                        nerd-icons-octicon "nf-oct-file_directory")
    578     (lisp-interaction-mode             nerd-icons-sucicon "nf-custom-emacs"           :face nerd-icons-orange)
    579     (sly-mrepl-mode                    nerd-icons-sucicon "nf-custom-common_lisp"     :face nerd-icons-orange)
    580     (slime-repl-mode                   nerd-icons-sucicon "nf-custom-common_lisp"     :face nerd-icons-orange)
    581     (org-mode                          nerd-icons-sucicon "nf-custom-orgmode"         :face nerd-icons-lgreen)
    582     (ledger-mode                       nerd-icons-mdicon "nf-md-file_table_box_multiple"   :face nerd-icons-green)
    583     (typescript-mode                   nerd-icons-mdicon "nf-md-language_typescript"  :face nerd-icons-blue-alt)
    584     (typescript-ts-mode                nerd-icons-mdicon "nf-md-language_typescript"  :face nerd-icons-blue-alt)
    585     (typescript-tsx-mode               nerd-icons-mdicon "nf-md-language_typescript"  :face nerd-icons-blue-alt)
    586     (tsx-ts-mode                       nerd-icons-mdicon "nf-md-language_typescript"  :face nerd-icons-blue-alt)
    587     (js-mode                           nerd-icons-devicon "nf-dev-javascript"         :face nerd-icons-yellow)
    588     (js-ts-mode                        nerd-icons-devicon "nf-dev-javascript"         :face nerd-icons-yellow)
    589     (js-jsx-mode                       nerd-icons-devicon "nf-dev-javascript"         :face nerd-icons-yellow)
    590     (js2-mode                          nerd-icons-devicon "nf-dev-javascript"         :face nerd-icons-yellow)
    591     (js3-mode                          nerd-icons-devicon "nf-dev-javascript"         :face nerd-icons-yellow)
    592     (rjsx-mode                         nerd-icons-devicon "nf-dev-javascript"         :face nerd-icons-cyan-alt)
    593     (term-mode                         nerd-icons-devicon "nf-dev-terminal")
    594     (vterm-mode                        nerd-icons-devicon "nf-dev-terminal")
    595     (eshell-mode                       nerd-icons-devicon "nf-dev-terminal"           :face nerd-icons-purple)
    596     (magit-refs-mode                   nerd-icons-devicon "nf-dev-git_branch"         :face nerd-icons-red)
    597     (magit-process-mode                nerd-icons-octicon "nf-oct-mark_github")
    598     (magit-diff-mode                   nerd-icons-devicon "nf-dev-git_compare"        :face nerd-icons-lblue)
    599     (ediff-mode                        nerd-icons-devicon "nf-dev-git_compare"        :face nerd-icons-red)
    600     (diff-mode                         nerd-icons-devicon "nf-dev-git_compare"        :face nerd-icons-lred)
    601     (comint-mode                       nerd-icons-faicon "nf-fa-terminal"             :face nerd-icons-lblue)
    602     (eww-mode                          nerd-icons-faicon "nf-fa-firefox"              :face nerd-icons-red)
    603     (xwidget-webkit-mode               nerd-icons-faicon "nf-fa-chrome"               :face nerd-icons-blue)
    604     (org-agenda-mode                   nerd-icons-octicon "nf-oct-checklist"          :face nerd-icons-lgreen)
    605     (cfw:calendar-mode                 nerd-icons-octicon "nf-oct-calendar")
    606     (ibuffer-mode                      nerd-icons-faicon "nf-fa-files_o"              :face nerd-icons-dsilver)
    607     (messages-buffer-mode              nerd-icons-faicon "nf-fa-file_o"               :face nerd-icons-dsilver)
    608     (help-mode                         nerd-icons-faicon "nf-fa-info"                 :face nerd-icons-purple)
    609     (helpful-mode                      nerd-icons-faicon "nf-fa-info"                 :face nerd-icons-purple)
    610     (Info-mode                         nerd-icons-faicon "nf-fa-info"                 :face nerd-icons-blue)
    611     (benchmark-init/tree-mode          nerd-icons-faicon "nf-fa-dashboard")
    612     (jenkins-mode                      nerd-icons-devicon "nf-dev-jenkins"            :face nerd-icons-blue)
    613     (magit-popup-mode                  nerd-icons-sucicon "nf-seti-git"               :face nerd-icons-red)
    614     (magit-status-mode                 nerd-icons-sucicon "nf-seti-git"               :face nerd-icons-lred)
    615     (magit-log-mode                    nerd-icons-sucicon "nf-seti-git"               :face nerd-icons-green)
    616     (mu4e-compose-mode                 nerd-icons-octicon "nf-oct-pencil")
    617     (mu4e-headers-mode                 nerd-icons-octicon "nf-oct-mail")
    618     (mu4e-main-mode                    nerd-icons-octicon "nf-oct-mail")
    619     (mu4e-view-mode                    nerd-icons-codicon "nf-cod-mail_read")
    620     (notmuch-hello-mode                nerd-icons-octicon "nf-oct-mail")
    621     (notmuch-search-mode               nerd-icons-octicon "nf-oct-mail")
    622     (notmuch-tree-mode                 nerd-icons-octicon "nf-oct-mail")
    623     (notmuch-show-mode                 nerd-icons-codicon "nf-cod-mail_read")
    624     (sieve-mode                        nerd-icons-octicon "nf-oct-mail")
    625     (gnus-group-mode                   nerd-icons-octicon "nf-oct-mail")
    626     (gnus-summary-mode                 nerd-icons-octicon "nf-oct-mail")
    627     (gnus-article-mode                 nerd-icons-codicon "nf-cod-mail_read")
    628     (message-mode                      nerd-icons-octicon "nf-oct-pencil")
    629     (package-menu-mode                 nerd-icons-faicon "nf-fa-archive"              :face nerd-icons-silver)
    630     (paradox-menu-mode                 nerd-icons-faicon "nf-fa-archive"              :face nerd-icons-silver)
    631     (Custom-mode                       nerd-icons-codicon "nf-cod-settings")
    632 
    633     ;; Special matcher for Web Mode based on the `web-mode-content-type' of the current buffer
    634     (web-mode                          nerd-icons--web-mode-icon)
    635 
    636     (fundamental-mode                  nerd-icons-sucicon "nf-custom-emacs"           :face nerd-icons-dsilver)
    637     (special-mode                      nerd-icons-sucicon "nf-custom-emacs"           :face nerd-icons-yellow)
    638     (cask-mode                         nerd-icons-sucicon "nf-custom-emacs"           :face nerd-icons-blue)
    639     (eask-mode                         nerd-icons-sucicon "nf-custom-emacs"           :face nerd-icons-blue)
    640     (text-mode                         nerd-icons-faicon "nf-fa-file_text"            :face nerd-icons-cyan)
    641     (enh-ruby-mode                     nerd-icons-devicon "nf-dev-ruby"               :face nerd-icons-lred)
    642     (ruby-mode                         nerd-icons-devicon "nf-dev-ruby"               :face nerd-icons-lred)
    643     (ruby-ts-mode                      nerd-icons-devicon "nf-dev-ruby"               :face nerd-icons-lred)
    644     (inf-ruby-mode                     nerd-icons-devicon "nf-dev-ruby"               :face nerd-icons-red)
    645     (projectile-rails-compilation-mode nerd-icons-devicon "nf-dev-ruby"               :face nerd-icons-red)
    646     (rspec-compilation-mode            nerd-icons-devicon "nf-dev-ruby"               :face nerd-icons-red)
    647     (rake-compilation-mode             nerd-icons-devicon "nf-dev-ruby"               :face nerd-icons-red)
    648     (sh-mode                           nerd-icons-devicon "nf-dev-terminal"           :face nerd-icons-purple)
    649     (bash-ts-mode                      nerd-icons-devicon "nf-dev-terminal"           :face nerd-icons-purple)
    650     (shell-mode                        nerd-icons-devicon "nf-dev-terminal"           :face nerd-icons-purple)
    651     (fish-mode                         nerd-icons-devicon "nf-dev-terminal"           :face nerd-icons-lpink)
    652     (bat-mode                          nerd-icons-codicon "nf-cod-terminal_cmd"       :face nerd-icons-lsilver)
    653     (nginx-mode                        nerd-icons-devicon "nf-dev-nginx"              :face nerd-icons-dgreen)
    654     ;; (apache-mode                    nerd-icons-alltheicon "apache"                 :face nerd-icons-dgreen)
    655     (makefile-mode                     nerd-icons-devicon "nf-dev-gnu"                :face nerd-icons-dorange)
    656     (makefile-ts-mode                  nerd-icons-devicon "nf-dev-gnu"                :face nerd-icons-dorange)
    657     ;; (cmake-mode                     nerd-icons-fileicon "cmake"                    :face nerd-icons-red)
    658     ;; (cmake-ts-mode                  nerd-icons-fileicon "cmake"                    :face nerd-icons-red)
    659     (dockerfile-mode                   nerd-icons-sucicon "nf-seti-docker"            :face nerd-icons-blue)
    660     (dockerfile-ts-mode                nerd-icons-sucicon "nf-seti-docker"            :face nerd-icons-blue)
    661     (docker-compose-mode               nerd-icons-sucicon "nf-seti-docker"            :face nerd-icons-lblue)
    662     (nxml-mode                         nerd-icons-faicon "nf-fa-file_code_o"          :face nerd-icons-lorange)
    663     (conf-mode                         nerd-icons-codicon "nf-cod-settings"           :face nerd-icons-lyellow)
    664     (json-mode                         nerd-icons-codicon "nf-cod-settings"           :face nerd-icons-yellow)
    665     (json-ts-mode                      nerd-icons-codicon "nf-cod-settings"           :face nerd-icons-yellow)
    666     (jsonian-mode                      nerd-icons-codicon "nf-cod-settings"           :face nerd-icons-yellow)
    667     (yaml-mode                         nerd-icons-codicon "nf-cod-settings"           :face nerd-icons-dyellow)
    668     (yaml-ts-mode                      nerd-icons-codicon "nf-cod-settings"           :face nerd-icons-dyellow)
    669     (toml-mode                         nerd-icons-codicon "nf-cod-settings"           :face nerd-icons-orange)
    670     (toml-ts-mode                      nerd-icons-codicon "nf-cod-settings"           :face nerd-icons-orange)
    671     (elisp-byte-code-mode              nerd-icons-octicon "nf-oct-file_binary"        :face nerd-icons-dsilver)
    672     (archive-mode                      nerd-icons-octicon "nf-oct-file_zip"           :face nerd-icons-lmaroon)
    673     (elm-mode                          nerd-icons-sucicon "nf-custom-elm"             :face nerd-icons-blue)
    674     (erlang-mode                       nerd-icons-devicon "nf-dev-erlang"             :face nerd-icons-red)
    675     (elixir-mode                       nerd-icons-sucicon "nf-custom-elixir"          :face nerd-icons-lorange)
    676     (elixir-ts-mode                    nerd-icons-sucicon "nf-custom-elixir"          :face nerd-icons-lorange)
    677     (java-mode                         nerd-icons-devicon "nf-dev-java"               :face nerd-icons-purple)
    678     (groovy-mode                       nerd-icons-devicon "nf-dev-groovy"             :face nerd-icons-cyan)
    679     (java-ts-mode                      nerd-icons-devicon "nf-dev-java"               :face nerd-icons-purple)
    680     (go-mode                           nerd-icons-devicon "nf-dev-go"                 :face nerd-icons-blue)
    681     (go-ts-mode                        nerd-icons-devicon "nf-dev-go"                 :face nerd-icons-blue)
    682     (go-dot-mod-mode                   nerd-icons-sucicon "nf-seti-config"            :face nerd-icons-blue-alt)
    683     (go-mod-ts-mode                    nerd-icons-sucicon "nf-seti-config"            :face nerd-icons-blue-alt)
    684     (go-dot-work-mode                  nerd-icons-sucicon "nf-seti-config"            :face nerd-icons-blue-alt)
    685     (graphql-mode                      nerd-icons-sucicon "nf-seti-graphql"           :face nerd-icons-dpink)
    686     ;; (matlab-mode                    nerd-icons-fileicon "matlab"                   :face nerd-icons-orange)
    687     (nix-mode                          nerd-icons-mdicon "nf-md-nix"                  :face nerd-icons-blue)
    688     (perl-mode                         nerd-icons-devicon "nf-dev-perl"               :face nerd-icons-lorange)
    689     (cperl-mode                        nerd-icons-devicon "nf-dev-perl"               :face nerd-icons-lorange)
    690     (php-mode                          nerd-icons-devicon "nf-dev-php"                :face nerd-icons-lsilver)
    691     (php-ts-mode                       nerd-icons-devicon "nf-dev-php"                :face nerd-icons-lsilver)
    692     (prolog-mode                       nerd-icons-devicon "nf-dev-prolog"             :face nerd-icons-lmaroon)
    693     (python-mode                       nerd-icons-devicon "nf-dev-python"             :face nerd-icons-dblue)
    694     (python-ts-mode                    nerd-icons-devicon "nf-dev-python"             :face nerd-icons-dblue)
    695     (inferior-python-mode              nerd-icons-devicon "nf-dev-python"             :face nerd-icons-dblue)
    696     ;; (racket-mode                    nerd-icons-fileicon "racket"                   :face nerd-icons-red)
    697     (rust-mode                         nerd-icons-devicon "nf-dev-rust"               :face nerd-icons-maroon)
    698     (rustic-mode                       nerd-icons-devicon "nf-dev-rust"               :face nerd-icons-maroon)
    699     (rust-ts-mode                      nerd-icons-devicon "nf-dev-rust"               :face nerd-icons-maroon)
    700     (scala-mode                        nerd-icons-devicon "nf-dev-scala"              :face nerd-icons-red)
    701     ;; (scheme-mode                    nerd-icons-fileicon   "scheme"                 :face nerd-icons-red)
    702     (swift-mode                        nerd-icons-devicon "nf-dev-swift"              :face nerd-icons-green)
    703     (svelte-mode                       nerd-icons-sucicon "nf-seti-svelte"            :face nerd-icons-red)
    704     (ada-mode                          nerd-icons-sucicon "nf-custom-ada"             :face nerd-icons-blue)
    705     (ada-ts-mode                       nerd-icons-sucicon "nf-custom-ada"             :face nerd-icons-blue)
    706     (gpr-mode                          nerd-icons-sucicon "nf-custom-ada"             :face nerd-icons-green)
    707     (gpr-ts-mode                       nerd-icons-sucicon "nf-custom-ada"             :face nerd-icons-green)
    708     (c-mode                            nerd-icons-sucicon "nf-custom-c"               :face nerd-icons-blue)
    709     (c-ts-mode                         nerd-icons-sucicon "nf-custom-c"               :face nerd-icons-blue)
    710     (c++-mode                          nerd-icons-sucicon "nf-custom-cpp"             :face nerd-icons-blue)
    711     (c++-ts-mode                       nerd-icons-sucicon "nf-custom-cpp"             :face nerd-icons-blue)
    712     (csharp-mode                       nerd-icons-mdicon "nf-md-language_csharp"      :face nerd-icons-dblue)
    713     (csharp-ts-mode                    nerd-icons-mdicon "nf-md-language_csharp"      :face nerd-icons-dblue)
    714     (clojure-mode                      nerd-icons-devicon "nf-dev-clojure_alt"        :face nerd-icons-blue)
    715     (clojure-ts-mode                   nerd-icons-devicon "nf-dev-clojure_alt"        :face nerd-icons-blue)
    716     (cider-repl-mode                   nerd-icons-devicon "nf-dev-clojure_alt"        :face nerd-icons-green)
    717     (clojurec-mode                     nerd-icons-sucicon "nf-seti-clojure"           :face nerd-icons-blue)
    718     (clojurec-ts-mode                  nerd-icons-sucicon "nf-seti-clojure"           :face nerd-icons-blue)
    719     (clojurescript-mode                nerd-icons-devicon "nf-dev-clojure_alt"        :face nerd-icons-lyellow)
    720     (clojurescript-ts-mode             nerd-icons-devicon "nf-dev-clojure_alt"        :face nerd-icons-lyellow)
    721     (coffee-mode                       nerd-icons-devicon "nf-dev-coffeescript"       :face nerd-icons-maroon)
    722     (lisp-mode                         nerd-icons-sucicon "nf-custom-scheme"          :face nerd-icons-orange)
    723     (css-mode                          nerd-icons-devicon "nf-dev-css3"               :face nerd-icons-yellow)
    724     (css-ts-mode                       nerd-icons-devicon "nf-dev-css3"               :face nerd-icons-yellow)
    725     (scss-mode                         nerd-icons-mdicon "nf-md-sass"                 :face nerd-icons-pink)
    726     (sass-mode                         nerd-icons-mdicon "nf-md-sass"                 :face nerd-icons-dpink)
    727     (less-css-mode                     nerd-icons-devicon "nf-dev-less"               :face nerd-icons-dyellow)
    728     (stylus-mode                       nerd-icons-devicon "nf-dev-stylus"             :face nerd-icons-lgreen)
    729     (csv-mode                          nerd-icons-octicon "nf-oct-graph"              :face nerd-icons-dblue)
    730     (gdscript-mode                     nerd-icons-sucicon "nf-seti-godot"             :face nerd-icons-blue)
    731     (gdscript-ts-mode                  nerd-icons-sucicon "nf-seti-godot"             :face nerd-icons-blue)
    732     (haskell-mode                      nerd-icons-devicon "nf-dev-haskell"            :face nerd-icons-red)
    733     (haskell-c2hs-mode                 nerd-icons-devicon "nf-dev-haskell"            :face nerd-icons-red)
    734     (literate-haskell-mode             nerd-icons-devicon "nf-dev-haskell"            :face nerd-icons-red)
    735     (haml-mode                         nerd-icons-sucicon "nf-seti-haml"              :face nerd-icons-lyellow)
    736     (html-mode                         nerd-icons-devicon "nf-dev-html5"              :face nerd-icons-orange)
    737     (html-ts-mode                      nerd-icons-devicon "nf-dev-html5"              :face nerd-icons-orange)
    738     (rhtml-mode                        nerd-icons-devicon "nf-dev-html5"              :face nerd-icons-lred)
    739     ;; (mustache-mode                  nerd-icons-fileicon "moustache"                :face nerd-icons-green)
    740     (slim-mode                         nerd-icons-codicon "nf-cod-dashboard"          :face nerd-icons-yellow)
    741     (jade-mode                         nerd-icons-sucicon "nf-seti-jade"              :face nerd-icons-red)
    742     (pug-mode                          nerd-icons-sucicon "nf-seti-pug"               :face nerd-icons-red)
    743     (react-mode                        nerd-icons-devicon "nf-dev-react"              :face nerd-icons-lblue)
    744     (image-mode                        nerd-icons-octicon "nf-oct-file_media"         :face nerd-icons-blue)
    745     (texinfo-mode                      nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    746     (markdown-mode                     nerd-icons-octicon "nf-oct-markdown"           :face nerd-icons-lblue)
    747     (markdown-ts-mode                  nerd-icons-octicon "nf-oct-markdown"           :face nerd-icons-lblue)
    748     ;; (bibtex-mode                    nerd-icons-fileicon "bib"                      :face nerd-icons-maroon)
    749     (compilation-mode                  nerd-icons-faicon "nf-fa-cogs")
    750     (objc-mode                         nerd-icons-faicon "nf-fa-apple")
    751     (tuareg-mode                       nerd-icons-sucicon "nf-seti-ocaml")
    752     (purescript-mode                   nerd-icons-sucicon "nf-seti-purescript")
    753     (verilog-mode                      nerd-icons-mdicon "nf-md-chip"                 :face nerd-icons-red)
    754     (verilog-ts-mode                   nerd-icons-mdicon "nf-md-chip"                 :face nerd-icons-red)
    755     (vhdl-mode                         nerd-icons-octicon "nf-oct-cpu"                :face nerd-icons-blue)
    756     (vhdl-ts-mode                      nerd-icons-octicon "nf-oct-cpu"                :face nerd-icons-blue)
    757     ;; (haskell-cabal-mode             nerd-icons-fileicon "cabal"                    :face nerd-icons-lblue)
    758     (kotlin-mode                       nerd-icons-sucicon "nf-custom-kotlin"          :face nerd-icons-orange)
    759     (kotlin-ts-mode                    nerd-icons-sucicon "nf-custom-kotlin"          :face nerd-icons-orange)
    760     (nim-mode                          nerd-icons-sucicon "nf-seti-nim"               :face nerd-icons-yellow)
    761     (sql-mode                          nerd-icons-devicon  "nf-dev-database"          :face nerd-icons-silver)
    762     (lua-mode                          nerd-icons-sucicon "nf-seti-lua"               :face nerd-icons-dblue)
    763     (lua-ts-mode                       nerd-icons-sucicon "nf-seti-lua"               :face nerd-icons-dblue)
    764     ;; (adoc-mode                      nerd-icons-fileicon "asciidoc"                 :face nerd-icons-lblue)
    765     (puppet-mode                       nerd-icons-sucicon "nf-custom-puppet"          :face nerd-icons-yellow)
    766     (jinja2-mode                       nerd-icons-sucicon "nf-seti-jinja"             :face nerd-icons-silver)
    767     (powershell-mode                   nerd-icons-mdicon "nf-md-powershell"           :face nerd-icons-blue)
    768     (tex-mode                          nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    769     (latex-mode                        nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    770     (latex-ts-mode                     nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    771     (doctex-mode                       nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    772     ;; Modes provided by AUCTeX 14.1 and higher
    773     (TeX-mode                          nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    774     (LaTeX-mode                        nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    775     (docTeX-mode                       nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    776     (ConTeXt-mode                      nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    777     (AmSTeX-mode                       nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    778     (plain-TeX-mode                    nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    779     (Texinfo-mode                      nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    780     (japanese-plain-TeX-mode           nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    781     (japanese-LaTeX-mode               nerd-icons-sucicon "nf-seti-tex"               :face nerd-icons-lred)
    782     (dart-mode                         nerd-icons-devicon "nf-dev-dart"               :face nerd-icons-blue)
    783     (fsharp-mode                       nerd-icons-devicon "nf-dev-fsharp"             :face nerd-icons-blue)
    784     (asm-mode                          nerd-icons-sucicon "nf-seti-asm"               :face nerd-icons-blue)
    785     (fasm-mode                         nerd-icons-sucicon "nf-seti-asm"               :face nerd-icons-blue)
    786     (masm-mode                         nerd-icons-sucicon "nf-seti-asm"               :face nerd-icons-blue)
    787     (nasm-mode                         nerd-icons-sucicon "nf-seti-asm"               :face nerd-icons-blue)
    788     (gas-mode                          nerd-icons-sucicon "nf-seti-asm"               :face nerd-icons-blue)
    789     ;; (tcl-mode                       nerd-icons-fileicon "tcl"                      :face nerd-icons-dred)
    790     ;; (cuda-mode                      nerd-icons-fileicon "nvidia"                   :face nerd-icons-green)
    791     (f90-mode                          nerd-icons-mdicon "nf-md-language_fortran"     :face nerd-icons-purple)
    792     ;; (hy-mode                        nerd-icons-fileicon "hy"                       :face nerd-icons-blue)
    793     (glsl-mode                         nerd-icons-faicon "nf-fa-paint_brush"          :face nerd-icons-green)
    794     (zig-mode                          nerd-icons-sucicon "nf-seti-zig"               :face nerd-icons-orange)
    795     ;; (odin-mode                      nerd-icons-fileicon "odin"                     :face nerd-icons-lblue)
    796     (pdf-view-mode                     nerd-icons-codicon  "nf-cod-file_pdf"          :face nerd-icons-dred)
    797     (doc-view-mode                     nerd-icons-mdicon   "nf-md-file_document"      :face nerd-icons-lred)
    798     (calibre-library-mode              nerd-icons-codicon  "nf-cod-library"           :face nerd-icons-dblue)
    799     (calibre-edit-mode                 nerd-icons-codicon  "nf-cod-library"           :face nerd-icons-lred)
    800     (calibredb-search-mode             nerd-icons-codicon  "nf-cod-library"           :face nerd-icons-dblue)
    801     (calibredb-show-mode               nerd-icons-codicon  "nf-cod-library"           :face nerd-icons-lblue)
    802     (osm-mode                          nerd-icons-mdicon   "nf-md-map_search"         :face nerd-icons-lgreen)
    803     (spacemacs-buffer-mode             nerd-icons-sucicon  "nf-custom-emacs"          :face nerd-icons-purple)
    804 
    805     (elfeed-search-mode                nerd-icons-faicon   "nf-fa-rss_square"         :face nerd-icons-orange)
    806     (elfeed-summary-mode               nerd-icons-faicon   "nf-fa-rss_square"         :face nerd-icons-orange)
    807     (elfeed-show-mode                  nerd-icons-faicon   "nf-fa-rss_square"         :face nerd-icons-yellow)
    808     (newsticker-treeview-mode          nerd-icons-faicon   "nf-fa-rss_square"         :face nerd-icons-orange)
    809     (newsticker-treeview-list-mode     nerd-icons-faicon   "nf-fa-rss_square"         :face nerd-icons-lorange)
    810     (newsticker-treeview-item-mode     nerd-icons-faicon   "nf-fa-rss_square"         :face nerd-icons-yellow)
    811 
    812     (emms-browser-mode                 nerd-icons-faicon   "nf-fa-music"              :face nerd-icons-silver)
    813     (emms-lyrics-mode                  nerd-icons-faicon   "nf-fa-music"              :face nerd-icons-silver)
    814     (emms-show-all-mode                nerd-icons-faicon   "nf-fa-music"              :face nerd-icons-silver)
    815     (emms-metaplaylist-mode            nerd-icons-faicon   "nf-fa-music"              :face nerd-icons-silver)
    816     (emms-tag-editor-mode              nerd-icons-faicon   "nf-fa-music"              :face nerd-icons-silver)
    817     (emms-playlist-mode                nerd-icons-faicon   "nf-fa-music"              :face nerd-icons-silver)
    818     (lilypond-mode                     nerd-icons-faicon   "nf-fa-music"              :face nerd-icons-green)
    819     (bongo-playlist-mode               nerd-icons-faicon "nf-fa-music"                :face nerd-icons-silver)
    820     (bongo-library-mode                nerd-icons-faicon "nf-fa-music"                :face nerd-icons-silver)
    821     (mingus-playlist-mode              nerd-icons-faicon "nf-fa-music"                :face nerd-icons-silver)
    822     (mingus-help-mode                  nerd-icons-faicon "nf-fa-music"                :face nerd-icons-silver)
    823     (mingus-browse-mode                nerd-icons-faicon "nf-fa-music"                :face nerd-icons-silver)
    824     (mingus-burn-mode                  nerd-icons-faicon "nf-fa-music"                :face nerd-icons-silver)
    825     (simple-mpc-mode                   nerd-icons-faicon "nf-fa-music"                :face nerd-icons-silver)
    826     (telega-root-mode                  nerd-icons-faicon "nf-fae-telegram"            :face nerd-icons-purple)
    827     (telega-chat-mode                  nerd-icons-faicon "nf-fae-telegram"            :face nerd-icons-blue)
    828     (mastodon-mode                     nerd-icons-mdicon "nf-md-mastodon"             :face nerd-icons-blue)
    829 
    830     (fanyi-mode                        nerd-icons-codicon "nf-cod-library"            :face nerd-icons-lcyan)
    831     (osx-dictionary-mode               nerd-icons-codicon "nf-cod-library"            :face nerd-icons-lcyan)
    832     (youdao-dictionary-mode            nerd-icons-codicon "nf-cod-library"            :face nerd-icons-lcyan)
    833 
    834     (magik-mode                        nerd-icons-faicon "nf-fa-magic"                :face nerd-icons-blue)
    835     (magik-ts-mode                     nerd-icons-faicon "nf-fa-magic"                :face nerd-icons-blue)
    836     (magik-session-mode                nerd-icons-devicon "nf-dev-terminal"           :face nerd-icons-blue)
    837     (magik-cb-mode                     nerd-icons-faicon "nf-fa-book"                 :face nerd-icons-blue)
    838     ;; (meson-mode                     nerd-icons-fileicon "meson"                    :face nerd-icons-purple)
    839     ;; (man-common                     nerd-icons-fileicon "man-page"                 :face nerd-icons-blue)
    840     (heex-mode                         nerd-icons-sucicon "nf-seti-elixir"            :face nerd-icons-lorange)
    841     (heex-ts-mode                      nerd-icons-sucicon "nf-seti-elixir"            :face nerd-icons-lorange)
    842     (julia-mode                        nerd-icons-sucicon "nf-seti-julia"             :face nerd-icons-purple)
    843     (julia-ts-mode                     nerd-icons-sucicon "nf-seti-julia"             :face nerd-icons-purple)
    844     (flycheck-error-list               nerd-icons-faicon "nf-fa-list_alt"             :face nerd-icons-lred)))
    845 
    846 (defvar nerd-icons-url-alist
    847   '(
    848     ;; Social media and communities
    849     ("^\\(https?://\\)?\\(www\\.\\)?del\\.icio\\.us"          nerd-icons-faicon "nf-fa-delicious")
    850     ("^\\(https?://\\)?\\(www\\.\\)?behance\\.net"            nerd-icons-faicon "nf-fa-behance")
    851     ("^\\(https?://\\)?\\(www\\.\\)?dribbble\\.com"           nerd-icons-faicon "nf-fa-dribbble")
    852     ("^\\(https?://\\)?\\(www\\.\\)?facebook\\.com"           nerd-icons-faicon "nf-fa-facebook_official")
    853     ("^\\(https?://\\)?\\(www\\.\\)?glide\\.me"               nerd-icons-faicon "nf-fa-glide_g")
    854     ("^\\(https?://\\)?\\(www\\.\\)?plus\\.google\\.com"      nerd-icons-faicon "nf-fa-google_plus")
    855     ("linkedin\\.com"                                         nerd-icons-faicon "nf-fa-linkedin")
    856     ("^\\(https?://\\)?\\(www\\.\\)?ok\\.ru"                  nerd-icons-faicon "nf-fa-odnoklassniki")
    857     ("^\\(https?://\\)?\\(www\\.\\)?reddit\\.com"             nerd-icons-faicon "nf-fa-reddit_alien")
    858     ("^\\(https?://\\)?\\(www\\.\\)?slack\\.com"              nerd-icons-faicon "nf-fa-slack")
    859     ("^\\(https?://\\)?\\(www\\.\\)?snapchat\\.com"           nerd-icons-faicon "nf-fa-snapchat_ghost")
    860     ("^\\(https?://\\)?\\(www\\.\\)?weibo\\.com"              nerd-icons-faicon "nf-fa-weibo")
    861     ("^\\(https?://\\)?\\(www\\.\\)?twitter\\.com"            nerd-icons-faicon "nf-fa-twitter")
    862     ;; Blogging
    863     ("joomla\\.org"                                           nerd-icons-faicon "nf-fa-joomla")
    864     ("^\\(https?://\\)?\\(www\\.\\)?medium\\.com"             nerd-icons-faicon "nf-fa-medium")
    865     ("tumblr\\.com"                                           nerd-icons-faicon "nf-fa-tumblr")
    866     ("^wordpress\\.com"                                       nerd-icons-faicon "nf-fa-wordpress")
    867     ;; Programming
    868     ("^\\(https?://\\)?\\(www\\.\\)?bitbucket\\.org"          nerd-icons-faicon "nf-fa-bitbucket")
    869     ("^\\(https?://\\)?\\(www\\.\\)?codepen\\.io"             nerd-icons-faicon "nf-fa-codepen")
    870     ("^\\(https?://\\)?\\(www\\.\\)?codiepie\\.com"           nerd-icons-faicon "nf-fa-codiepie")
    871     ("^\\(https?://\\)?\\(www\\.\\)?gist\\.github\\.com"      nerd-icons-octicon "nf-oct-logo_gist")
    872     ("^\\(https?://\\)?\\(www\\.\\)?github\\.com"             nerd-icons-octicon "nf-oct-mark_github")
    873     ("^\\(https?://\\)?\\(www\\.\\)?gitlab\\.com"             nerd-icons-faicon "nf-fa-gitlab")
    874     ("^\\(https?://\\)?\\(www\\.\\)?news\\.ycombinator\\.com" nerd-icons-faicon "nf-fa-hacker_news")
    875     ("^\\(https?://\\)?\\(www\\.\\)?jsfiddle\\.net"           nerd-icons-faicon "nf-fa-jsfiddle")
    876     ("^\\(https?://\\)?\\(www\\.\\)?maxcdn\\.com"             nerd-icons-faicon "nf-fa-maxcdn")
    877     ("^\\(https?://\\)?\\(www\\.\\)?stackoverflow\\.com"      nerd-icons-faicon "nf-fa-stack_overflow")
    878     ;; Video
    879     ("^\\(https?://\\)?\\(www\\.\\)?twitch\\.tv"              nerd-icons-faicon "nf-fa-twitch")
    880     ("^\\(https?://\\)?\\(www\\.\\)?vimeo\\.com"              nerd-icons-faicon "nf-fa-vimeo")
    881     ("^\\(https?://\\)?\\(www\\.\\)?youtube\\.com"            nerd-icons-faicon "nf-fa-youtube")
    882     ("^\\(https?://\\)?\\(www\\.\\)?youtu\\.be"               nerd-icons-faicon "nf-fa-youtube")
    883     ("^\\(https?://\\)?\\(www\\.\\)?vine\\.co"                nerd-icons-faicon "nf-fa-vine")
    884     ;; Sound
    885     ("^\\(https?://\\)?\\(www\\.\\)?last\\.fm"                nerd-icons-faicon "nf-fa-lastfm")
    886     ("^\\(https?://\\)?\\(www\\.\\)?mixcloud\\.com"           nerd-icons-faicon "nf-fa-mixcloud")
    887     ("^\\(https?://\\)?\\(www\\.\\)?soundcloud\\.com"         nerd-icons-faicon "nf-fa-soundcloud")
    888     ("spotify\\.com"                                          nerd-icons-faicon "nf-fa-spotify")
    889     ;; Shopping
    890     ("^\\(https?://\\)?\\(www\\.\\)?amazon\\."                nerd-icons-faicon "nf-fa-amazon")
    891     ("^\\(https?://\\)?\\(www\\.\\)?opencart\\.com"           nerd-icons-faicon "nf-fa-opencart")
    892     ("^\\(https?://\\)?\\(www\\.\\)?paypal\\.com"             nerd-icons-faicon "nf-fa-paypal")
    893     ("^\\(https?://\\)?\\(www\\.\\)?shirtsinbulk\\.com"       nerd-icons-faicon "nf-fa-shitsinbulk")
    894     ;; Images
    895     ("^\\(https?://\\)?\\(www\\.\\)?500px\\.com"              nerd-icons-faicon "nf-fa-500px")
    896     ("^\\(https?://\\)?\\(www\\.\\)?deviantart\\.com"         nerd-icons-faicon "nf-fa-deviantart")
    897     ("^\\(https?://\\)?\\(www\\.\\)?flickr\\.com"             nerd-icons-faicon "nf-fa-flickr")
    898     ("^\\(https?://\\)?\\(www\\.\\)?instagram\\.com"          nerd-icons-faicon "nf-fa-instagram")
    899     ("^\\(https?://\\)?\\(www\\.\\)?pinterest\\."             nerd-icons-faicon "nf-fa-pinterest")
    900     ;; Information and books
    901     ("^\\(https?://\\)?\\(www\\.\\)?digg\\.com"               nerd-icons-faicon "nf-fa-digg")
    902     ("^\\(https?://\\)?\\(www\\.\\)?foursquare\\.com"         nerd-icons-faicon "nf-fa-foursquare")
    903     ("^\\(https?://\\)?\\(www\\.\\)?getpocket\\.com"          nerd-icons-faicon "nf-fa-get_pocket")
    904     ("^\\(https?://\\)?\\(www\\.\\)?scribd\\.com"             nerd-icons-faicon "nf-fa-scribd")
    905     ("^\\(https?://\\)?\\(www\\.\\)?slideshare\\.net"         nerd-icons-faicon "nf-fa-slideshare")
    906     ("stackexchange\\.com"                                    nerd-icons-faicon "nf-fa-stack_exchange")
    907     ("^\\(https?://\\)?\\(www\\.\\)?stumbleupon\\.com"        nerd-icons-faicon "nf-fa-stumbleupon")
    908     ("^\\(https?://\\)?\\(www\\.\\)?tripadvisor\\."           nerd-icons-faicon "nf-fa-tripadvisor")
    909     ("^\\(https?://\\)?\\(www\\.\\)?yelp\\."                  nerd-icons-faicon "nf-fa-yelp")
    910 
    911     ("wikipedia\\.org"                                        nerd-icons-faicon "nf-fa-wikipedia_w")
    912     ;; Various companies and tools
    913     ("^\\(https?://\\)?\\(www\\.\\)?angel\\.co"               nerd-icons-faicon "nf-fa-angellist")
    914     ("^\\(https?://\\)?\\(www\\.\\)?apple\\.com"              nerd-icons-faicon "nf-fa-apple")
    915     ("^\\(https?://\\)?\\(www\\.\\)?buysellads\\.com"         nerd-icons-faicon "nf-fa-buysellads")
    916     ("^\\(https?://\\)?\\(www\\.\\)?connectdevelop\\.com"     nerd-icons-faicon "nf-fa-connectdevelop")
    917     ("^\\(https?://\\)?\\(www\\.\\)?dashcube\\.com"           nerd-icons-faicon "nf-fa-dashcube")
    918     ("^\\(https?://\\)?\\(www\\.\\)?dropbox\\.com"            nerd-icons-faicon "nf-fa-dropbox")
    919     ("^\\(https?://\\)?\\(www\\.\\)?enviragallery\\.com"      nerd-icons-faicon "nf-fa-envira")
    920     ("^\\(https?://\\)?\\(www\\.\\)?fortawesome\\.com"        nerd-icons-faicon "nf-fa-fort_awesome")
    921     ("^\\(https?://\\)?\\(www\\.\\)?forumbee\\.com"           nerd-icons-faicon "nf-fa-forumbee")
    922     ("^\\(https?://\\)?\\(www\\.\\)?gratipay\\.com"           nerd-icons-faicon "nf-fa-gratipay")
    923     ("^\\(https?://\\)?\\(www\\.\\)?modx\\.com"               nerd-icons-faicon "nf-fa-modx")
    924     ("^\\(https?://\\)?\\(www\\.\\)?pagelines\\.com"          nerd-icons-faicon "nf-fa-pagelines")
    925     ("^\\(https?://\\)?\\(www\\.\\)?producthunt\\.com"        nerd-icons-faicon "nf-fa-product_hunt")
    926     ("sellsy\\.com"                                           nerd-icons-faicon "nf-fa-sellsy")
    927     ("^\\(https?://\\)?\\(www\\.\\)?simplybuilt\\.com"        nerd-icons-faicon "nf-fa-simplybuilt")
    928     ("^\\(https?://\\)?\\(www\\.\\)?skyatlas\\.com"           nerd-icons-faicon "nf-fa-skyatlas")
    929     ("^\\(https?://\\)?\\(www\\.\\)?skype\\.com"              nerd-icons-faicon "nf-fa-skype")
    930     ("steampowered\\.com"                                     nerd-icons-faicon "nf-fa-steam")
    931     ("^\\(https?://\\)?\\(www\\.\\)?themeisle\\.com"          nerd-icons-faicon "nf-fa-themeisle")
    932     ("^\\(https?://\\)?\\(www\\.\\)?trello\\.com"             nerd-icons-faicon "nf-fa-trello")
    933     ("^\\(https?://\\)?\\(www\\.\\)?whatsapp\\.com"           nerd-icons-faicon "nf-fa-whatsapp")
    934     ("^\\(https?://\\)?\\(www\\.\\)?ycombinator\\.com"        nerd-icons-faicon "nf-fa-y_combinator")
    935     ("yahoo\\.com"                                            nerd-icons-faicon "nf-fa-yahoo")
    936     ("^\\(https?://\\)?\\(www\\.\\)?yoast\\.com"              nerd-icons-faicon "nf-fa-yoast")
    937     ;; Catch all
    938     ("android"                                                nerd-icons-faicon "nf-fa-android")
    939     ("creativecommons"                                        nerd-icons-faicon "nf-fa-creative_commons")
    940     ("forums?"                                                nerd-icons-codicon "nf-cod-comment_discussion")
    941     ("\\.pdf$"                                                nerd-icons-codicon "nf-cod-file_pdf" :face nerd-icons-dred)
    942     ("google"                                                 nerd-icons-faicon "nf-fa-google")
    943     ("\\.rss"                                                 nerd-icons-faicon "nf-fa-rss")))
    944 
    945 (defun nerd-icons-auto-mode-match? (&optional file)
    946   "Whether or not FILE's `major-mode' match against its `auto-mode-alist'."
    947   (let* ((file (or file (buffer-file-name) (buffer-name)))
    948          (auto-mode (nerd-icons-match-to-alist file auto-mode-alist)))
    949     (eq major-mode auto-mode)))
    950 
    951 (defun nerd-icons-match-to-alist (file alist)
    952   "Match FILE against an entry in ALIST using `string-match'."
    953   (cdr (cl-find-if (lambda (it) (string-match (car it) file)) alist)))
    954 
    955 (defun nerd-icons-dir-is-submodule (dir)
    956   "Checker whether or not DIR is a git submodule."
    957   (let* ((gitmodule-dir (locate-dominating-file dir ".gitmodules"))
    958          (modules-file  (expand-file-name (format "%s.gitmodules" gitmodule-dir)))
    959          (module-search (format "submodule \".*?%s\"" (file-name-base dir))))
    960 
    961     (when (and gitmodule-dir (file-exists-p (format "%s/.git" dir)))
    962       (with-temp-buffer
    963         (insert-file-contents modules-file)
    964         (search-forward-regexp module-search (point-max) t)))))
    965 
    966 (defun nerd-icons--read-candidates ()
    967   "Helper to build a list of candidates for all glyph sets."
    968   (cl-reduce 'append (mapcar (lambda (it) (nerd-icons--read-candidates-for-glyph-set it t)) nerd-icons-glyph-sets)))
    969 
    970 (defun nerd-icons--read-candidates-for-glyph-set (glyph-set &optional show-glyph-set)
    971   "Helper to build read candidates for GLYPH-SET.
    972 
    973 If SHOW-GLYPH-SET is non-nil, displays the icons glyph set in the candidate
    974 string."
    975   (let ((data   (funcall (nerd-icons--data-name glyph-set)))
    976         (icon-f (nerd-icons--function-name glyph-set)))
    977     (mapcar
    978      (lambda (it)
    979        (let* ((icon-name (car it))
    980 
    981               (icon-display (funcall icon-f icon-name))
    982               (icon-glyph-set (if show-glyph-set (format "\t[%s]" glyph-set) ""))
    983 
    984               (candidate-name (format "%s\t%s%s" icon-display icon-name icon-glyph-set))
    985               (candidate-icon (funcall (nerd-icons--function-name glyph-set) icon-name)))
    986          (cons candidate-name candidate-icon)))
    987      data)))
    988 
    989 ;;;###autoload
    990 (defun nerd-icons-install-fonts (&optional pfx)
    991   "Helper function to download and install the latests fonts based on OS.
    992 The provided Nerd Font is Symbols Nerd Font Mono.
    993 When PFX is non-nil, ignore the prompt and just install"
    994   (interactive "P")
    995   (when (or pfx (yes-or-no-p "This will download and install fonts, are you sure you want to do this?"))
    996     (let* ((url-format "https://raw.githubusercontent.com/rainstormstudio/nerd-icons.el/main/fonts/%s")
    997            (font-dest (cond
    998                        ;; Default Linux install directories
    999                        ((member system-type '(gnu gnu/linux gnu/kfreebsd))
   1000                         (concat (or (getenv "XDG_DATA_HOME")
   1001                                     (concat (getenv "HOME") "/.local/share"))
   1002                                 "/fonts/"
   1003                                 nerd-icons-fonts-subdirectory))
   1004                        ;; Default MacOS install directory
   1005                        ((eq system-type 'darwin)
   1006                         (concat (getenv "HOME")
   1007                                 "/Library/Fonts/"
   1008                                 nerd-icons-fonts-subdirectory))))
   1009            (known-dest? (stringp font-dest))
   1010            (font-dest (or font-dest (read-directory-name "Font installation directory: " "~/"))))
   1011 
   1012       (unless (file-directory-p font-dest) (mkdir font-dest t))
   1013 
   1014       (mapc (lambda (font)
   1015               (url-copy-file (format url-format font) (expand-file-name font font-dest) t))
   1016             nerd-icons-font-names)
   1017       (when known-dest?
   1018         (message "Fonts downloaded, updating font cache... <fc-cache -f -v> ")
   1019         (shell-command-to-string (format "fc-cache -f -v")))
   1020       (message "%s Successfully %s `nerd-icons' fonts to `%s'!"
   1021                (nerd-icons-wicon "nf-weather-stars" :v-adjust 0.0)
   1022                (if known-dest? "installed" "downloaded")
   1023                font-dest))))
   1024 
   1025 ;;;###autoload
   1026 (defun nerd-icons-insert (&optional arg glyph-set)
   1027   "Interactive icon insertion function.
   1028 When Prefix ARG is non-nil, insert the propertized icon.
   1029 When GLYPH-SET is non-nil, limit the candidates to the icon set matching it."
   1030   (interactive "P")
   1031   (let* ((standard-output (current-buffer))
   1032          (candidates (if glyph-set
   1033                          (nerd-icons--read-candidates-for-glyph-set glyph-set)
   1034                        (nerd-icons--read-candidates)))
   1035          (prompt     (if glyph-set
   1036                          (format "%s Icon: " (funcall (nerd-icons--glyph-set-name glyph-set)))
   1037                        "Icon : "))
   1038          (selection (completing-read prompt candidates nil t))
   1039          (result    (cdr (assoc selection candidates))))
   1040 
   1041     (if arg (prin1 result) (insert result))))
   1042 
   1043 ;;;###autoload
   1044 (defun nerd-icons-icon-for-dir (dir &rest arg-overrides)
   1045   "Get the formatted icon for DIR.
   1046 ARG-OVERRIDES should be a plist containining `:height',
   1047 `:v-adjust' or `:face' properties like in the normal icon
   1048 inserting functions."
   1049   (let* ((dir (or dir default-directory "/"))
   1050          (dirname (file-name-base (directory-file-name dir)))
   1051          (path (if (file-name-absolute-p dir) dir (expand-file-name dir)))
   1052          (icon (nerd-icons-match-to-alist dirname nerd-icons-dir-icon-alist))
   1053          (args (cdr icon)))
   1054     (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
   1055     (cond
   1056      ((file-remote-p path)
   1057       (apply #'nerd-icons-codicon "nf-cod-remote" (cdr args)))
   1058      ((file-symlink-p path)
   1059       (apply #'nerd-icons-codicon "nf-cod-file_symlink_directory" (cdr args)))
   1060      ((nerd-icons-dir-is-submodule path)
   1061       (apply #'nerd-icons-codicon "nf-cod-file_submodule" (cdr args)))
   1062      ((file-exists-p (format "%s/.git" path))
   1063       (apply #'nerd-icons-octicon "nf-oct-repo" (cdr args)))
   1064      (t (apply (car icon) args)))))
   1065 
   1066 ;;;###autoload
   1067 (defun nerd-icons-icon-for-file (file &rest arg-overrides)
   1068   "Get the formatted icon for FILE.
   1069 ARG-OVERRIDES should be a plist containining `:height',
   1070 `:v-adjust' or `:face' properties like in the normal icon
   1071 inserting functions."
   1072   (let* ((name (file-name-nondirectory file))
   1073          (ext (file-name-extension name))
   1074          (icon (or (nerd-icons-match-to-alist name nerd-icons-regexp-icon-alist)
   1075                    (and ext
   1076                         (cdr (assoc (downcase ext)
   1077                                     nerd-icons-extension-icon-alist)))
   1078                    nerd-icons-default-file-icon))
   1079          (args (cdr icon)))
   1080     (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
   1081     (apply (car icon) args)))
   1082 
   1083 ;;;###autoload
   1084 (defun nerd-icons-icon-for-extension (ext &rest arg-overrides)
   1085   "Get the formatted icon for EXT.
   1086 ARG-OVERRIDES should be a plist containining `:height',
   1087 `:v-adjust' or `:face' properties like in the normal icon
   1088 inserting functions."
   1089   (let* ((icon (or
   1090                 (and ext
   1091                      (cdr (assoc (downcase ext)
   1092                                  nerd-icons-extension-icon-alist)))
   1093                 nerd-icons-default-file-icon))
   1094          (args (cdr icon)))
   1095     (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
   1096     (apply (car icon) args)))
   1097 
   1098 ;;;###autoload
   1099 (defun nerd-icons-icon-for-mode (mode &rest arg-overrides)
   1100   "Get the formatted icon for MODE.
   1101 ARG-OVERRIDES should be a plist containining `:height',
   1102 `:v-adjust' or `:face' properties like in the normal icon
   1103 inserting functions."
   1104   (let* ((icon (or (cdr (or (assoc mode nerd-icons-mode-icon-alist)
   1105                             (assoc (get mode 'derived-mode-parent) nerd-icons-mode-icon-alist)))
   1106                    nerd-icons-default-file-icon))
   1107          (args (cdr icon)))
   1108     (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
   1109     (if icon (apply (car icon) args) mode)))
   1110 
   1111 ;;;###autoload
   1112 (defun nerd-icons-icon-for-url (url &rest arg-overrides)
   1113   "Get the formatted icon for URL.
   1114 If an icon for URL isn't found in `nerd-icons-url-alist', a globe is used.
   1115 ARG-OVERRIDES should be a plist containining `:height',
   1116 `:v-adjust' or `:face' properties like in the normal icon
   1117 inserting functions."
   1118   (let* ((icon (nerd-icons-match-to-alist url nerd-icons-url-alist))
   1119          (args (cdr icon)))
   1120     (unless icon
   1121       (setq icon '(nerd-icons-faicon "nf-fa-globe"))
   1122       (setq args (cdr icon)))
   1123     (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
   1124     (apply (car icon) args)))
   1125 
   1126 ;;;###autoload
   1127 (defun nerd-icons-icon-for-buffer ()
   1128   "Get the formatted icon for the current buffer.
   1129 
   1130 This function prioritises the use of the buffers file extension to
   1131 discern the icon when its `major-mode' matches its auto mode,
   1132 otherwise it will use the buffers `major-mode' to decide its
   1133 icon."
   1134   (nerd-icons--icon-info-for-buffer))
   1135 
   1136 (defun nerd-icons-cache (func)
   1137   "Set a cache for FUNC.  Does not work on interactive functions."
   1138   (unless (get func 'nerd-icons--cached)
   1139     (let ((cache (make-hash-table :test #'equal
   1140                                   :size nerd-icons--cache-limit))
   1141           (orig-fn (symbol-function func)))
   1142       (fset func
   1143             (lambda (&rest args)
   1144               (or (gethash args cache)
   1145                   (progn
   1146                     (when (> (hash-table-count cache)
   1147                              nerd-icons--cache-limit)
   1148                       (clrhash cache))
   1149                     (puthash args (apply orig-fn args) cache)))))))
   1150 
   1151   (put func 'nerd-icons--cached t))
   1152 
   1153 (nerd-icons-cache #'nerd-icons-icon-for-dir)
   1154 (nerd-icons-cache #'nerd-icons-icon-for-file)
   1155 (nerd-icons-cache #'nerd-icons-icon-for-extension)
   1156 (nerd-icons-cache #'nerd-icons-icon-for-mode)
   1157 (nerd-icons-cache #'nerd-icons-icon-for-url)
   1158 
   1159 (defun nerd-icons--icon-info-for-buffer (&optional f)
   1160   "Get icon info for the current buffer.
   1161 When F is provided, the info function is calculated with the format
   1162 `nerd-icons-icon-%s-for-file' or `nerd-icons-icon-%s-for-mode'."
   1163   (let* ((base-f (concat "nerd-icons-icon" (when f (format "-%s" f))))
   1164          (file-f (intern (concat base-f "-for-file")))
   1165          (mode-f (intern (concat base-f "-for-mode"))))
   1166     (if (and (buffer-file-name)
   1167              (nerd-icons-auto-mode-match?))
   1168         (funcall file-f (file-name-nondirectory (buffer-file-name)))
   1169       (funcall mode-f major-mode))))
   1170 
   1171 ;; Weather icons
   1172 (defun nerd-icons-icon-for-weather (weather)
   1173   "Get an icon for a WEATHER status."
   1174   (let ((icon (nerd-icons-match-to-alist weather nerd-icons-weather-icon-alist)))
   1175     (if icon (apply (car icon) (cdr icon)) weather)))
   1176 
   1177 ;; For `web-mode'
   1178 (defun nerd-icons--web-mode-icon (&rest arg-overrides)
   1179   "Get icon for a `web-mode' buffer with ARG-OVERRIDES."
   1180   (nerd-icons--web-mode arg-overrides))
   1181 (defun nerd-icons--web-mode-icon-family ()
   1182   "Get icon family for a `web-mode' buffer."
   1183   (nerd-icons--web-mode t))
   1184 
   1185 (defvar web-mode-content-type)          ; external
   1186 (defun nerd-icons--web-mode (&optional arg-overrides)
   1187   "Return icon or FAMILY for `web-mode' based on `web-mode-content-type'.
   1188 Providing ARG-OVERRIDES will modify the creation of the icon."
   1189   (let ((non-nil-args (cl-reduce (lambda (acc it) (if it (append acc (list it)) acc))
   1190                                  arg-overrides :initial-value '())))
   1191     (cond
   1192      ((equal web-mode-content-type "jsx")
   1193       (apply 'nerd-icons-devicon (append '("javascript") non-nil-args)))
   1194      ((equal web-mode-content-type "javascript")
   1195       (apply 'nerd-icons-devicon (append '("javascript") non-nil-args)))
   1196      ((equal web-mode-content-type "json")
   1197       (apply 'nerd-icons-devicon (append '("nf-dev-less") non-nil-args)))
   1198      ((equal web-mode-content-type "xml")
   1199       (apply 'nerd-icons-faicon (append '("nf-fa-file_code_o") non-nil-args)))
   1200      ((equal web-mode-content-type "css")
   1201       (apply 'nerd-icons-devicon (append '("nf-dev-css3") non-nil-args)))
   1202      (t
   1203       (apply 'nerd-icons-devicon (append '("nf-dev-html5") non-nil-args))))))
   1204 
   1205 (eval-and-compile
   1206   (defun nerd-icons--function-name (name)
   1207     "Get the symbol for an icon function name for icon set NAME."
   1208     (intern (concat "nerd-icons-" (downcase (symbol-name name)))))
   1209 
   1210   (defun nerd-icons--family-name (name)
   1211     "Get the symbol for an icon family function for icon set NAME."
   1212     (intern (concat "nerd-icons-" (downcase (symbol-name name)) "-family")))
   1213 
   1214   (defun nerd-icons--glyph-set-name (name)
   1215     "Get the symbol for an icon glyph set function for icon set NAME."
   1216     (intern (concat "nerd-icons-" (downcase (symbol-name name)) "-glyph-set")))
   1217 
   1218   (defun nerd-icons--data-name (name)
   1219     "Get the symbol for an icon family function for icon set NAME."
   1220     (intern (concat "nerd-icons-" (downcase (symbol-name name)) "-data")))
   1221 
   1222   (defun nerd-icons--insert-function-name (name)
   1223     "Get the symbol for an icon insert function for icon set NAME."
   1224     (intern (concat "nerd-icons-insert-" (downcase (symbol-name name))))))
   1225 
   1226 (defun nerd-icons-insert-icons-for (family &optional height duration)
   1227   "Insert all of the available icons associated with FAMILY.
   1228 If a HEIGHT is provided it will render the icons at this height.
   1229 This is useful both to see the icons more clearly and to test
   1230 different height rendering.  If DURATION is provided, it will
   1231 pause for DURATION seconds between printing each character."
   1232   (let* ((data-f    (nerd-icons--data-name family))
   1233          (insert-f  (nerd-icons--function-name family))
   1234 
   1235          (height (or height 1.0))
   1236          (data (funcall data-f)))
   1237     (mapc
   1238      (lambda (it)
   1239        (insert (format "%s - %s\n" (funcall insert-f (car it) :height height) (car it)))
   1240        (when duration (sit-for duration)))
   1241      data)))
   1242 
   1243 (defun nerd-icons-set-font (&optional font-family frame)
   1244   "Modify nerd font charsets to use FONT-FAMILY for FRAME."
   1245   (let ((font-f (or font-family nerd-icons-font-family))
   1246         (charsets '((#xe5fa . #xe6b2)  ;; Seti-UI + Custom
   1247                     (#xe700 . #xe7c5)  ;; Devicons
   1248                     (#xf000 . #xf2e0)  ;; Font Awesome
   1249                     (#xe200 . #xe2a9)  ;; Font Awesome Extension
   1250                     (#xf500 . #xfd46) (#xf0001 . #xf1af0) ;; Material Design Icons
   1251                     (#xe300 . #xe3eb)  ;; Weather
   1252                     (#xf400 . #xf4a8) #x2665 #x26a1 #xf27c  ;; Octicons
   1253                     (#xe0a0 . #xe0a2) (#xe0b0 . #xe0b3)  ;; Powerline Symbols
   1254                     #xe0a3 (#xe0b4 . #xe0c8) (#xe0cc . #xe0d2) #xe0d4  ;; Powerline Extra Symbols
   1255                     (#x23fb . #x23fe) #x2b58  ;; IEC Power Symbols
   1256                     (#xf300 . #xf372)  ;; Font Logos
   1257                     (#xe000 . #xe00a)  ;; Pomicons
   1258                     (#xea60 . #xebeb))))  ;; Codicons
   1259     (cl-loop for charset in charsets do
   1260              (set-fontset-font
   1261               (frame-parameter nil 'font)
   1262               charset
   1263               (font-spec :family font-f
   1264                          :weight nil
   1265                          :size   nil)
   1266               frame
   1267               'prepend))))
   1268 
   1269 (defmacro nerd-icons-define-icon (name alist family glyph-set)
   1270   "Macro to generate functions for inserting icons for icon set NAME.
   1271 
   1272 NAME defines is the name of the iconset and will produce a
   1273 function of the for `nerd-icon-NAME'.
   1274 
   1275 ALIST is the alist containing maps between icon names and the
   1276 UniCode for the character.  All of these can be found in the data
   1277 directory of this package.
   1278 
   1279 FAMILY is the font family to use for the icons.
   1280 GLYPH-SET is the glyph set of the icon."
   1281   `(progn
   1282      (add-to-list 'nerd-icons-glyph-sets (quote ,name))
   1283      (defun ,(nerd-icons--family-name name) () ,family)
   1284      (defun ,(nerd-icons--glyph-set-name name) () ,glyph-set)
   1285      (defun ,(nerd-icons--data-name name) () ,alist)
   1286      (defun ,(nerd-icons--function-name name) (icon-name &rest args)
   1287        (let ((icon (cdr (assoc icon-name ,alist)))
   1288              (other-face (when nerd-icons-color-icons (plist-get args :face)))
   1289              (height (* nerd-icons-scale-factor (or (plist-get args :height) 1.0)))
   1290              (v-adjust (* nerd-icons-scale-factor (or (plist-get args :v-adjust) nerd-icons-default-adjust)))
   1291              (family ,family))
   1292          (unless icon
   1293            (error "Unable to find icon with name `%s' in icon set `%s'" icon-name (quote ,name)))
   1294          (let ((face (if other-face
   1295                          `(:family ,family :height ,height :inherit ,other-face)
   1296                        `(:family ,family :height ,height))))
   1297            (propertize icon
   1298                        'face face
   1299                        'font-lock-face face
   1300                        'display `(raise ,v-adjust)
   1301                        'rear-nonsticky t))))
   1302      (defun ,(nerd-icons--insert-function-name name) (&optional arg)
   1303        ,(format "Insert a %s icon at point." glyph-set)
   1304        (interactive "P")
   1305        (nerd-icons-insert arg (quote ,name)))))
   1306 
   1307 (nerd-icons-define-icon ipsicon nerd-icons/ipsicon-alist nerd-icons-font-family "IEC Power Symbols")
   1308 (nerd-icons-define-icon octicon nerd-icons/octicon-alist nerd-icons-font-family "Octicons")
   1309 (nerd-icons-define-icon pomicon nerd-icons/pomicon-alist nerd-icons-font-family "Pomicons")
   1310 (nerd-icons-define-icon powerline nerd-icons/powerline-alist nerd-icons-font-family "Powerline Symbols")
   1311 (nerd-icons-define-icon faicon nerd-icons/faicon-alist nerd-icons-font-family "Font Awesome")
   1312 (nerd-icons-define-icon wicon nerd-icons/wicon-alist nerd-icons-font-family "Weather")
   1313 (nerd-icons-define-icon sucicon nerd-icons/sucicon-alist nerd-icons-font-family "Seti-UI + Custom")
   1314 (nerd-icons-define-icon devicon nerd-icons/devicon-alist nerd-icons-font-family "Devicons")
   1315 (nerd-icons-define-icon codicon nerd-icons/codicon-alist nerd-icons-font-family "Codicons")
   1316 (nerd-icons-define-icon flicon nerd-icons/flicon-alist nerd-icons-font-family "Font Logos")
   1317 (nerd-icons-define-icon mdicon nerd-icons/mdicon-alist nerd-icons-font-family "Material Design Icons")
   1318 
   1319 (provide 'nerd-icons)
   1320 ;;; nerd-icons.el ends here