dotemacs

My Emacs configuration
git clone git://git.entf.net/dotemacs
Log | Files | Refs | LICENSE

all-the-icons.el (77618B)


      1 ;;; all-the-icons.el --- A library for inserting Developer icons -*- lexical-binding: t; -*-
      2 
      3 ;; Copyright (C) 2016  Dominic Charlesworth <dgc336@gmail.com>
      4 
      5 ;; Author: Dominic Charlesworth <dgc336@gmail.com>
      6 ;; Version: 5.0.0
      7 ;; Package-Requires: ((emacs "24.3"))
      8 ;; URL: https://github.com/domtronn/all-the-icons.el
      9 ;; Keywords: convenient, lisp
     10 
     11 ;; This program is free software; you can redistribute it and/or
     12 ;; modify it under the terms of the GNU General Public License
     13 ;; as published by the Free Software Foundation; either version 3
     14 ;; of the License, or (at your option) any later version.
     15 
     16 ;; This program is distributed in the hope that it will be useful,
     17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
     18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     19 ;; GNU General Public License for more details.
     20 
     21 ;; You should have received a copy of the GNU General Public License
     22 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
     23 
     24 ;;; Commentary:
     25 
     26 ;; This package is a utility for using and formatting various Icon
     27 ;; fonts within Emacs.  Icon Fonts allow you to propertize and format
     28 ;; icons the same way you would normal text.  This enables things such
     29 ;; as better scaling of and anti aliasing of the icons.
     30 
     31 ;; This package was inspired by
     32 
     33 ;; - `mode-icons' for Emacs, found at https://github.com/ryuslash/mode-icons
     34 ;; - `file-icons' for Atom, found at https://atom.io/packages/file-icons
     35 
     36 ;; Currently, this package provides an interface to the following Icon Fonts
     37 
     38 ;; - Atom File Icons,       found at https://atom.io/packages/file-icons
     39 ;; - FontAwesome Icons,     found at http://fontawesome.io/
     40 ;; - GitHub Octicons,       found at http://octicons.github.com
     41 ;; - Material Design Icons, found at http://google.github.io/material-design-icons/
     42 ;; - Weather Icons,         found at https://erikflowers.github.io/weather-icons/
     43 ;; - AllTheIcons,           a custom Icon Font maintained as part of this package
     44 
     45 ;; Requests for new icons will be accepted and added to the AllTheIcons Icon Font
     46 
     47 ;;; Usage:
     48 
     49 ;; The simplest usage for this package is to use the following functions;
     50 
     51 ;;   `all-the-icons-icon-for-buffer'
     52 ;;   `all-the-icons-icon-for-dir'
     53 ;;   `all-the-icons-icon-for-file'
     54 ;;   `all-the-icons-icon-for-mode'
     55 ;;   `all-the-icons-icon-for-url'
     56 
     57 ;; Which can be used to get a formatted icon for the current buffer, a
     58 ;; file name, a major mode, or an URL respectively.  e.g.
     59 
     60 ;;   (insert (all-the-icons-icon-for-file "foo.js"))
     61 
     62 ;; Inserts a JavaScript icon formatted like this
     63 
     64 ;;   #("some-icon" 0 1 (display (raise -0.24)
     65 ;;              face (:family "dev-icons" :height 1.08 :foreground "#FFD446")))
     66 
     67 ;; You can also insert icons directly using the individual icon family
     68 ;; functions
     69 
     70 ;;   `all-the-icons-alltheicon'     // Custom font with fewest icons
     71 ;;   `all-the-icons-devicon'        // Developer Icons
     72 ;;   `all-the-icons-faicon'         // Font Awesome Icons
     73 ;;   `all-the-icons-fileicon'       // File Icons from the Atom File Icons package
     74 ;;   `all-the-icons-octicon'        // GitHub Octicons
     75 ;;   `all-the-icons-material'       // Material Design Icons
     76 ;;   `all-the-icons-wicon'          // Weather Icons
     77 
     78 ;; You can call these functions with the icon name you want to insert, e.g.
     79 
     80 ;;   (all-the-icons-octicon "file-binary")  // GitHub Octicon for Binary File
     81 ;;   (all-the-icons-faicon  "cogs")         // FontAwesome icon for cogs
     82 ;;   (all-the-icons-wicon   "tornado")      // Weather Icon for tornado
     83 
     84 ;; A list of all the icon names for the different font families can be
     85 ;; found in the data directory, or by inspecting the alist variables.
     86 ;; All the alist variables are prefixed with `all-the-icons-data/'
     87 
     88 ;;; Code:
     89 (require 'cl-lib)
     90 
     91 (require 'data-alltheicons  "./data/data-alltheicons.el")
     92 (require 'data-faicons      "./data/data-faicons.el")
     93 (require 'data-fileicons    "./data/data-fileicons.el")
     94 (require 'data-octicons     "./data/data-octicons.el")
     95 (require 'data-weathericons "./data/data-weathericons.el")
     96 (require 'data-material     "./data/data-material.el")
     97 
     98 (require 'all-the-icons-faces)
     99 
    100 (defvar web-mode-content-type) ;silence byte-compiler warning
    101 ;;; Custom Variables
    102 (defgroup all-the-icons nil
    103   "Manage how All The Icons formats icons."
    104   :prefix "all-the-icons-"
    105   :group 'appearance
    106   :group 'convenience)
    107 
    108 (defcustom all-the-icons-color-icons t
    109   "Whether or not to include a foreground colour when formatting the icon."
    110   :group 'all-the-icons
    111   :type 'boolean)
    112 
    113 (defcustom all-the-icons-scale-factor 1.2
    114   "The base Scale Factor for the `height' face property of an icon."
    115   :group 'all-the-icons
    116   :type 'number)
    117 
    118 (defcustom all-the-icons-default-adjust -0.2
    119   "The default adjustment to be made to the `raise' display property of an icon."
    120   :group 'all-the-icons
    121   :type 'number)
    122 
    123 (defvar all-the-icons-font-families '() "List of defined icon font families.")
    124 (defvar all-the-icons-font-names '() "List of defined font file names this package was built with.")
    125 
    126 (defvar all-the-icons-extension-icon-alist
    127   '(
    128     ("fish"         all-the-icons-alltheicon "terminal"       :face all-the-icons-lpink)
    129     ("zsh"          all-the-icons-alltheicon "terminal"       :face all-the-icons-lcyan)
    130     ("sh"           all-the-icons-alltheicon "terminal"       :face all-the-icons-purple)
    131     ;; Meta
    132     ("tags"         all-the-icons-octicon "tag"               :height 1.0 :v-adjust 0.0 :face all-the-icons-blue)
    133     ("log"          all-the-icons-octicon "bug"               :height 1.0 :v-adjust 0.0 :face all-the-icons-maroon)
    134     ;; Config
    135     ("node"         all-the-icons-alltheicon "nodejs"         :height 1.0  :face all-the-icons-green)
    136     ("babelrc"      all-the-icons-fileicon "babel"            :face all-the-icons-yellow)
    137     ("bashrc"       all-the-icons-alltheicon "script"         :height 0.9  :face all-the-icons-dpink)
    138     ("bowerrc"      all-the-icons-alltheicon "bower"          :height 1.0 :v-adjust 0.0 :face all-the-icons-silver)
    139     ("ini"          all-the-icons-octicon "settings"          :v-adjust 0.0 :face all-the-icons-yellow)
    140     ("eslintignore" all-the-icons-fileicon "eslint"           :height 0.9  :face all-the-icons-purple)
    141     ("eslint"       all-the-icons-fileicon "eslint"           :height 0.9  :face all-the-icons-lpurple)
    142     ("git"          all-the-icons-alltheicon "git"            :height 1.0  :face all-the-icons-lred)
    143     ("mk"           all-the-icons-fileicon "gnu"              :face all-the-icons-dorange)
    144     ("cmake"        all-the-icons-fileicon "cmake"            :face all-the-icons-red)
    145     ("dockerignore" all-the-icons-fileicon "dockerfile"       :height 1.2  :face all-the-icons-dblue)
    146     ("xml"          all-the-icons-faicon "file-code-o"        :height 0.95 :face all-the-icons-lorange)
    147     ("json"         all-the-icons-octicon "settings"          :v-adjust 0.0 :face all-the-icons-yellow)
    148     ("cson"         all-the-icons-octicon "settings"          :v-adjust 0.0 :face all-the-icons-yellow)
    149     ("yml"          all-the-icons-octicon "settings"          :v-adjust 0.0 :face all-the-icons-dyellow)
    150     ("yaml"         all-the-icons-octicon "settings"          :v-adjust 0.0 :face all-the-icons-dyellow)
    151     ;; ?
    152     ("pkg"          all-the-icons-octicon "package"           :v-adjust 0.0 :face all-the-icons-dsilver)
    153     ("rpm"          all-the-icons-octicon "package"           :v-adjust 0.0 :face all-the-icons-dsilver)
    154     ("elc"          all-the-icons-octicon "file-binary"       :v-adjust 0.0 :face all-the-icons-dsilver)
    155     ("gz"           all-the-icons-octicon "file-binary"       :v-adjust 0.0 :face all-the-icons-lmaroon)
    156     ("zip"          all-the-icons-octicon "file-zip"          :v-adjust 0.0 :face all-the-icons-lmaroon)
    157     ("7z"           all-the-icons-octicon "file-zip"          :v-adjust 0.0 :face all-the-icons-lmaroon)
    158     ("dat"          all-the-icons-faicon "bar-chart"          :face all-the-icons-cyan :height 0.9)
    159     ("dmg"          all-the-icons-octicon "tools"             :v-adjust 0.0 :face all-the-icons-lsilver)
    160     ("dll"          all-the-icons-faicon "cogs"               :face all-the-icons-silver)
    161     ("ds_store"     all-the-icons-faicon "cogs"               :face all-the-icons-silver)
    162     ;; Source Codes
    163     ("scpt"         all-the-icons-fileicon "apple"            :face all-the-icons-pink)
    164     ("aup"          all-the-icons-fileicon "audacity"         :face all-the-icons-yellow)
    165     ("elm"          all-the-icons-fileicon "elm"              :face all-the-icons-blue)
    166     ("erl"          all-the-icons-alltheicon "erlang"         :face all-the-icons-red :v-adjust -0.1 :height 0.9)
    167     ("hrl"          all-the-icons-alltheicon "erlang"         :face all-the-icons-dred :v-adjust -0.1 :height 0.9)
    168     ("eex"          all-the-icons-alltheicon "elixir"         :face all-the-icons-lorange :v-adjust -0.1 :height 0.9)
    169     ("leex"         all-the-icons-alltheicon "elixir"         :face all-the-icons-lorange :v-adjust -0.1 :height 0.9)
    170     ("ex"           all-the-icons-alltheicon "elixir"         :face all-the-icons-lpurple :v-adjust -0.1 :height 0.9)
    171     ("exs"          all-the-icons-alltheicon "elixir"         :face all-the-icons-lred :v-adjust -0.1 :height 0.9)
    172     ("java"         all-the-icons-alltheicon "java"           :height 1.0  :face all-the-icons-purple)
    173     ("go"           all-the-icons-alltheicon "go"             :height 1.0  :face all-the-icons-blue)
    174     ("jl"           all-the-icons-fileicon "julia"            :face all-the-icons-purple :v-adjust 0.0)
    175     ("matlab"       all-the-icons-fileicon "matlab"           :face all-the-icons-orange)
    176     ("nix"          all-the-icons-fileicon "nix"              :face all-the-icons-blue)
    177     ("pl"           all-the-icons-alltheicon "perl"           :face all-the-icons-lorange)
    178     ("pm"           all-the-icons-alltheicon "perl"           :face all-the-icons-lorange)
    179     ("pl6"          all-the-icons-fileicon "perl6"            :face all-the-icons-cyan)
    180     ("pm6"          all-the-icons-fileicon "perl6"            :face all-the-icons-pink)
    181     ("pod"          all-the-icons-alltheicon "perldocs"       :height 1.2  :face all-the-icons-lgreen)
    182     ("php"          all-the-icons-fileicon "php"              :face all-the-icons-lsilver)
    183     ("pony"         all-the-icons-fileicon "pony"             :face all-the-icons-maroon)
    184     ("ps1"          all-the-icons-fileicon "powershell"       :face all-the-icons-blue)
    185     ("pro"          all-the-icons-alltheicon "prolog"         :height 1.1  :face all-the-icons-lmaroon)
    186     ("proog"        all-the-icons-alltheicon "prolog"         :height 1.1  :face all-the-icons-lmaroon)
    187     ("py"           all-the-icons-alltheicon "python"         :height 1.0  :face all-the-icons-dblue)
    188     ("ipynb"        all-the-icons-fileicon "jupyter"          :height 1.0  :face all-the-icons-dorange)
    189     ("rkt"          all-the-icons-fileicon "racket"           :height 1.2 :face all-the-icons-red)
    190     ("gem"          all-the-icons-alltheicon "ruby-alt"       :face all-the-icons-red)
    191     ("rb"           all-the-icons-octicon "ruby"              :v-adjust 0.0 :face all-the-icons-lred)
    192     ("rs"           all-the-icons-alltheicon "rust"           :height 1.2  :face all-the-icons-maroon)
    193     ("rlib"         all-the-icons-alltheicon "rust"           :height 1.2  :face all-the-icons-dmaroon)
    194     ("r"            all-the-icons-fileicon "R"                :face all-the-icons-lblue)
    195     ("rd"           all-the-icons-fileicon "R"                :face all-the-icons-lblue)
    196     ("rdx"          all-the-icons-fileicon "R"                :face all-the-icons-lblue)
    197     ("rs"           all-the-icons-fileicon "R"                :face all-the-icons-lblue)
    198     ("rsx"          all-the-icons-fileicon "R"                :face all-the-icons-lblue)
    199     ;; There seems to be a a bug with this font icon which does not
    200     ;; let you propertise it without it reverting to being a lower
    201     ;; case phi
    202     ("c"            all-the-icons-alltheicon "c-line"         :face all-the-icons-blue)
    203     ("h"            all-the-icons-alltheicon "c-line"         :face all-the-icons-purple)
    204     ("m"            all-the-icons-fileicon "apple"            :v-adjust 0.0 :height 1.0)
    205     ("mm"           all-the-icons-fileicon "apple"            :v-adjust 0.0 :height 1.0)
    206     ;;
    207     ("cc"           all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-blue)
    208     ("cpp"          all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-blue)
    209     ("cxx"          all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-blue)
    210     ("hh"           all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-purple)
    211     ("hpp"          all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-purple)
    212     ("hxx"          all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-purple)
    213     ;; Lisps
    214     ("cl"           all-the-icons-fileicon "clisp"            :face all-the-icons-lorange)
    215     ("l"            all-the-icons-fileicon "lisp"             :face all-the-icons-orange)
    216     ("lisp"         all-the-icons-fileicon "lisp"             :face all-the-icons-orange)
    217     ("el"           all-the-icons-fileicon "elisp"            :height 1.0 :v-adjust -0.2 :face all-the-icons-purple)
    218     ("clj"          all-the-icons-alltheicon "clojure-line"   :height 1.0 :face all-the-icons-blue :v-adjust 0.0)
    219     ("cljc"         all-the-icons-alltheicon "clojure-line"   :height 1.0 :face all-the-icons-blue :v-adjust 0.0)
    220     ("cljs"         all-the-icons-fileicon "cljs"             :height 1.0 :face all-the-icons-dblue :v-adjust 0.0)
    221     ("coffee"       all-the-icons-alltheicon "coffeescript"   :height 1.0  :face all-the-icons-maroon)
    222     ("iced"         all-the-icons-alltheicon "coffeescript"   :height 1.0  :face all-the-icons-lmaroon)
    223     ("dart"         all-the-icons-fileicon "dart"             :height 1.0 :face all-the-icons-blue :v-adjust 0.0)
    224     ;; Stylesheeting
    225     ("css"          all-the-icons-alltheicon "css3"           :face all-the-icons-yellow)
    226     ("scss"         all-the-icons-alltheicon "sass"           :face all-the-icons-pink)
    227     ("sass"         all-the-icons-alltheicon "sass"           :face all-the-icons-dpink)
    228     ("less"         all-the-icons-alltheicon "less"           :height 0.8  :face all-the-icons-dyellow)
    229     ("postcss"      all-the-icons-fileicon "postcss"          :face all-the-icons-dred)
    230     ("sss"          all-the-icons-fileicon "postcss"          :face all-the-icons-dred)
    231     ("styl"         all-the-icons-alltheicon "stylus"         :face all-the-icons-lgreen)
    232     ("csv"          all-the-icons-octicon "graph"             :v-adjust 0.0 :face all-the-icons-dblue)
    233     ;; haskell
    234     ("hs"           all-the-icons-alltheicon "haskell"        :height 1.0  :face all-the-icons-red)
    235     ("chs"          all-the-icons-alltheicon "haskell"        :height 1.0  :face all-the-icons-red)
    236     ("lhs"          all-the-icons-alltheicon "haskell"        :height 1.0  :face all-the-icons-red)
    237     ("hsc"          all-the-icons-alltheicon "haskell"        :height 1.0  :face all-the-icons-red)
    238     ;; Web modes
    239     ("inky-haml"    all-the-icons-fileicon "haml"             :face all-the-icons-lyellow)
    240     ("haml"         all-the-icons-fileicon "haml"             :face all-the-icons-lyellow)
    241     ("htm"          all-the-icons-alltheicon "html5"          :face all-the-icons-orange)
    242     ("html"         all-the-icons-alltheicon "html5"          :face all-the-icons-orange)
    243     ("inky-er"      all-the-icons-alltheicon "html5"          :face all-the-icons-lred)
    244     ("inky-erb"     all-the-icons-alltheicon "html5"          :face all-the-icons-lred)
    245     ("erb"          all-the-icons-alltheicon "html5"          :face all-the-icons-lred)
    246     ("hbs"          all-the-icons-fileicon "moustache"        :face all-the-icons-green)
    247     ("inky-slim"    all-the-icons-octicon "dashboard"         :v-adjust 0.0 :face all-the-icons-yellow)
    248     ("slim"         all-the-icons-octicon "dashboard"         :v-adjust 0.0 :face all-the-icons-yellow)
    249     ("jade"         all-the-icons-fileicon "jade"             :face all-the-icons-red)
    250     ("pug"          all-the-icons-fileicon "pug-alt"          :face all-the-icons-red)
    251     ;; Javascript
    252     ("d3js"         all-the-icons-alltheicon "d3"             :height 0.8  :face all-the-icons-lgreen)
    253     ("re"           all-the-icons-fileicon "reason"           :height 1.0  :face all-the-icons-red-alt)
    254     ("rei"          all-the-icons-fileicon "reason"           :height 1.0  :face all-the-icons-dred)
    255     ("ml"           all-the-icons-fileicon "ocaml"            :height 1.0  :face all-the-icons-lpink)
    256     ("mli"          all-the-icons-fileicon "ocaml"            :height 1.0  :face all-the-icons-dpink)
    257     ("react"        all-the-icons-alltheicon "react"          :height 1.1  :face all-the-icons-lblue)
    258     ("ts"           all-the-icons-fileicon "typescript"       :height 1.0 :v-adjust -0.1 :face all-the-icons-blue-alt)
    259     ("js"           all-the-icons-alltheicon "javascript"     :height 1.0 :v-adjust 0.0 :face all-the-icons-yellow)
    260     ("es"           all-the-icons-alltheicon "javascript"     :height 1.0 :v-adjust 0.0 :face all-the-icons-yellow)
    261     ("jsx"          all-the-icons-fileicon "jsx-2"            :height 1.0 :v-adjust -0.1 :face all-the-icons-cyan-alt)
    262     ("njs"          all-the-icons-alltheicon "nodejs"         :height 1.2  :face all-the-icons-lgreen)
    263     ("vue"          all-the-icons-fileicon "vue"              :face all-the-icons-lgreen)
    264 
    265     ("sbt"          all-the-icons-fileicon   "sbt"            :face all-the-icons-red)
    266     ("scala"        all-the-icons-alltheicon "scala"          :face all-the-icons-red)
    267     ("scm"          all-the-icons-fileicon   "scheme"         :height 1.2 :face all-the-icons-red)
    268     ("swift"        all-the-icons-alltheicon "swift"          :height 1.0 :v-adjust -0.1 :face all-the-icons-green)
    269 
    270     ("tcl"          all-the-icons-fileicon "tcl"              :height 1.0 :face all-the-icons-dred)
    271 
    272     ("tf"           all-the-icons-fileicon "terraform"        :height 1.0 :face all-the-icons-purple-alt)
    273     ("tfvars"       all-the-icons-fileicon "terraform"        :height 1.0 :face all-the-icons-purple-alt)
    274     ("tfstate"      all-the-icons-fileicon "terraform"        :height 1.0 :face all-the-icons-purple-alt)
    275 
    276     ("asm"          all-the-icons-fileicon "assembly"         :height 1.0 :face all-the-icons-blue)
    277     ;; Verilog(-AMS) and SystemVerilog(-AMS)
    278     ("v"            all-the-icons-fileicon "verilog"          :height 1.0 :v-adjust -0.2 :face all-the-icons-red)
    279     ("vams"         all-the-icons-fileicon "verilog"          :height 1.0 :v-adjust -0.2 :face all-the-icons-red)
    280     ("sv"           all-the-icons-fileicon "verilog"          :height 1.0 :v-adjust -0.2 :face all-the-icons-red)
    281     ("sva"          all-the-icons-fileicon "verilog"          :height 1.0 :v-adjust -0.2 :face all-the-icons-red)
    282     ("svh"          all-the-icons-fileicon "verilog"          :height 1.0 :v-adjust -0.2 :face all-the-icons-red)
    283     ("svams"        all-the-icons-fileicon "verilog"          :height 1.0 :v-adjust -0.2 :face all-the-icons-red)
    284     ;; VHDL(-AMS)
    285     ("vhd"          all-the-icons-fileicon "vhdl"             :face all-the-icons-blue)
    286     ("vhdl"         all-the-icons-fileicon "vhdl"             :face all-the-icons-blue)
    287     ("vhms"         all-the-icons-fileicon "vhdl"             :face all-the-icons-blue)
    288     ;; Cabal
    289     ("cabal"        all-the-icons-fileicon "cabal"            :face all-the-icons-lblue)
    290     ;; Kotlin
    291     ("kt"           all-the-icons-fileicon "kotlin"           :face all-the-icons-orange)
    292     ("kts"          all-the-icons-fileicon "kotlin"           :face all-the-icons-orange)
    293     ;; Nimrod
    294     ("nim"          all-the-icons-fileicon "nimrod"           :face all-the-icons-yellow)
    295     ("nims"         all-the-icons-fileicon "nimrod"           :face all-the-icons-yellow)
    296     ;; SQL
    297     ("sql"          all-the-icons-octicon "database"          :face all-the-icons-silver)
    298     ;; Styles
    299     ("styles"       all-the-icons-material "style"            :face all-the-icons-red)
    300     ;; Lua
    301     ("lua"          all-the-icons-fileicon "lua"              :face all-the-icons-dblue)
    302     ;; ASCII doc
    303     ("adoc"         all-the-icons-fileicon "asciidoc"         :face all-the-icons-lblue)
    304     ("asciidoc"     all-the-icons-fileicon "asciidoc"         :face all-the-icons-lblue)
    305     ;; Puppet
    306     ("pp"           all-the-icons-fileicon "puppet"           :face all-the-icons-yellow)
    307     ;; Jinja
    308     ("j2"           all-the-icons-fileicon "jinja"            :face all-the-icons-silver)
    309     ("jinja2"       all-the-icons-fileicon "jinja"            :face all-the-icons-silver)
    310     ;; Docker
    311     ("dockerfile"   all-the-icons-fileicon "dockerfile"       :face all-the-icons-cyan)
    312     ;; Vagrant
    313     ("vagrantfile"  all-the-icons-fileicon "vagrant"          :face all-the-icons-blue)
    314     ;; GLSL
    315     ("glsl"     all-the-icons-fileicon "vertex-shader"        :face all-the-icons-blue)
    316     ("vert"     all-the-icons-fileicon "vertex-shader"        :face all-the-icons-blue)
    317     ("tesc"     all-the-icons-fileicon "vertex-shader"        :face all-the-icons-purple)
    318     ("tese"     all-the-icons-fileicon "vertex-shader"        :face all-the-icons-dpurple)
    319     ("geom"     all-the-icons-fileicon "vertex-shader"        :face all-the-icons-green)
    320     ("frag"     all-the-icons-fileicon "vertex-shader"        :face all-the-icons-red)
    321     ("comp"     all-the-icons-fileicon "vertex-shader"        :face all-the-icons-dblue)
    322     ;; CUDA
    323     ("cu"       all-the-icons-fileicon "nvidia"               :face all-the-icons-green)
    324     ("cuh"      all-the-icons-fileicon "nvidia"               :face all-the-icons-green)
    325     ;; C#
    326     ("cs"           all-the-icons-alltheicon "csharp-line"    :face all-the-icons-dblue)
    327     ("csx"          all-the-icons-alltheicon "csharp-line"    :face all-the-icons-dblue)
    328     ;; F#
    329     ("fs"           all-the-icons-fileicon "fsharp"           :face all-the-icons-blue-alt)
    330     ("fsi"          all-the-icons-fileicon "fsharp"           :face all-the-icons-blue-alt)
    331     ("fsx"          all-the-icons-fileicon "fsharp"           :face all-the-icons-blue-alt)
    332     ("fsscript"     all-the-icons-fileicon "fsharp"           :face all-the-icons-blue-alt)
    333     ;; zig
    334     ("zig"          all-the-icons-fileicon "zig"              :face all-the-icons-orange)
    335     ;; File Types
    336     ("ico"          all-the-icons-octicon "file-media"        :v-adjust 0.0 :face all-the-icons-blue)
    337     ("png"          all-the-icons-octicon "file-media"        :v-adjust 0.0 :face all-the-icons-orange)
    338     ("gif"          all-the-icons-octicon "file-media"        :v-adjust 0.0 :face all-the-icons-green)
    339     ("jpeg"         all-the-icons-octicon "file-media"        :v-adjust 0.0 :face all-the-icons-dblue)
    340     ("jpg"          all-the-icons-octicon "file-media"        :v-adjust 0.0 :face all-the-icons-dblue)
    341     ;; Audio
    342     ("mp3"          all-the-icons-faicon "volume-up"          :face all-the-icons-dred)
    343     ("wav"          all-the-icons-faicon "volume-up"          :face all-the-icons-dred)
    344     ("m4a"          all-the-icons-faicon "volume-up"          :face all-the-icons-dred)
    345     ("ogg"          all-the-icons-faicon "volume-up"          :face all-the-icons-dred)
    346     ("flac"         all-the-icons-faicon "volume-up"          :face all-the-icons-dred)
    347     ("opus"         all-the-icons-faicon "volume-up"          :face all-the-icons-dred)
    348     ("au"           all-the-icons-faicon "volume-up"          :face all-the-icons-dred)
    349     ("aif"          all-the-icons-faicon "volume-up"          :face all-the-icons-dred)
    350     ("aifc"         all-the-icons-faicon "volume-up"          :face all-the-icons-dred)
    351     ("aiff"         all-the-icons-faicon "volume-up"          :face all-the-icons-dred)
    352     ("svg"          all-the-icons-alltheicon "svg"            :height 0.9  :face all-the-icons-lgreen)
    353     ;; Video
    354     ("mov"          all-the-icons-faicon "film"               :face all-the-icons-blue)
    355     ("mp4"          all-the-icons-faicon "film"               :face all-the-icons-blue)
    356     ("ogv"          all-the-icons-faicon "film"               :face all-the-icons-dblue)
    357     ("mpg"          all-the-icons-faicon "film"                :face all-the-icons-blue)
    358     ("mpeg"         all-the-icons-faicon "film"                :face all-the-icons-blue)
    359     ("flv"          all-the-icons-faicon "film"                :face all-the-icons-blue)
    360     ("ogv"          all-the-icons-faicon "film"                :face all-the-icons-dblue)
    361     ("mkv"          all-the-icons-faicon "film"               :face all-the-icons-blue)
    362     ("webm"         all-the-icons-faicon "film"               :face all-the-icons-blue)
    363     ;; Fonts
    364     ("ttf"          all-the-icons-fileicon "font"             :v-adjust 0.0 :face all-the-icons-dcyan)
    365     ("woff"         all-the-icons-fileicon "font"             :v-adjust 0.0 :face all-the-icons-cyan)
    366     ("woff2"        all-the-icons-fileicon "font"             :v-adjust 0.0 :face all-the-icons-cyan)
    367     ;; Doc
    368     ("pdf"          all-the-icons-octicon "file-pdf"          :v-adjust 0.0 :face all-the-icons-dred)
    369     ("text"         all-the-icons-octicon "file-text"         :v-adjust 0.0 :face all-the-icons-cyan)
    370     ("txt"          all-the-icons-octicon "file-text"         :v-adjust 0.0 :face all-the-icons-cyan)
    371     ("doc"          all-the-icons-fileicon "word"             :face all-the-icons-blue)
    372     ("docx"         all-the-icons-fileicon "word"             :face all-the-icons-blue)
    373     ("docm"         all-the-icons-fileicon "word"             :face all-the-icons-blue)
    374     ("texi"         all-the-icons-fileicon "tex"              :face all-the-icons-lred)
    375     ("tex"          all-the-icons-fileicon "tex"              :face all-the-icons-lred)
    376     ("md"           all-the-icons-octicon "markdown"          :v-adjust 0.0 :face all-the-icons-lblue)
    377     ("bib"          all-the-icons-fileicon "bib"              :face all-the-icons-maroon)
    378     ("org"          all-the-icons-fileicon "org"              :face all-the-icons-lgreen)
    379     ("pps"          all-the-icons-fileicon "powerpoint"       :face all-the-icons-orange)
    380     ("ppt"          all-the-icons-fileicon "powerpoint"       :face all-the-icons-orange)
    381     ("pptsx"        all-the-icons-fileicon "powerpoint"       :face all-the-icons-orange)
    382     ("ppttx"        all-the-icons-fileicon "powerpoint"       :face all-the-icons-orange)
    383     ("knt"          all-the-icons-fileicon "powerpoint"       :face all-the-icons-cyan)
    384     ("xlsx"         all-the-icons-fileicon "excel"            :face all-the-icons-dgreen)
    385     ("xlsm"         all-the-icons-fileicon "excel"            :face all-the-icons-dgreen)
    386     ("xlsb"         all-the-icons-fileicon "excel"            :face all-the-icons-dgreen)
    387     ("xltx"         all-the-icons-fileicon "excel"            :face all-the-icons-dgreen)
    388     ("xltm"         all-the-icons-fileicon "excel"            :face all-the-icons-dgreen)
    389     ;;
    390     ("key"          all-the-icons-octicon "key"               :v-adjust 0.0 :face all-the-icons-lblue)
    391     ("pem"          all-the-icons-octicon "key"               :v-adjust 0.0 :face all-the-icons-orange)
    392     ("p12"          all-the-icons-octicon "key"               :v-adjust 0.0 :face all-the-icons-dorange)
    393     ("crt"          all-the-icons-octicon "key"               :v-adjust 0.0 :face all-the-icons-lblue)
    394     ("pub"          all-the-icons-octicon "key"               :v-adjust 0.0 :face all-the-icons-blue)
    395     ("gpg"          all-the-icons-octicon "key"               :v-adjust 0.0 :face all-the-icons-lblue)
    396     ("cache"        all-the-icons-octicon "database"          :height 1.0 :v-adjust 0.0 :face all-the-icons-green)))
    397 
    398 
    399 (define-obsolete-variable-alias 'all-the-icons-icon-alist
    400   'all-the-icons-regexp-icon-alist
    401   "5.0.0"
    402   "`all-the-icons-icon-alist' has been split to
    403 `all-the-icons-extension-icon-alist' and `all-the-icons-regexp-icon-alist'
    404 for performance sake.")
    405 
    406 (defvar all-the-icons-regexp-icon-alist
    407   '(
    408     ;;
    409     ("^TAGS$"           all-the-icons-octicon "tag"                     :height 1.0 :v-adjust 0.0 :face all-the-icons-blue)
    410     ("^TODO$"           all-the-icons-octicon "checklist"               :v-adjust 0.0 :face all-the-icons-lyellow)
    411     ("^LICENSE$"        all-the-icons-octicon "book"                    :height 1.0 :v-adjust 0.0 :face all-the-icons-blue)
    412     ("^readme"          all-the-icons-octicon "book"                    :height 1.0 :v-adjust 0.0 :face all-the-icons-lcyan)
    413 
    414     ;; Config
    415     ("^bower.json$"     all-the-icons-alltheicon "bower"                :height 1.0 :v-adjust 0.0 :face all-the-icons-lorange)
    416     ("nginx"            all-the-icons-fileicon "nginx"                  :height 0.9  :face all-the-icons-dgreen)
    417     ("apache"           all-the-icons-alltheicon "apache"               :height 0.9  :face all-the-icons-dgreen)
    418     ("^Makefile$"       all-the-icons-fileicon "gnu"                    :face all-the-icons-dorange)
    419     ("^CMakeLists.txt$" all-the-icons-fileicon "cmake"                  :face all-the-icons-red)
    420     ("^CMakeCache.txt$" all-the-icons-fileicon "cmake"                  :face all-the-icons-blue)
    421 
    422     ("^\\.?Dockerfile"  all-the-icons-fileicon "dockerfile"             :face all-the-icons-blue)
    423     ("^Brewfile$"       all-the-icons-faicon "beer"                     :face all-the-icons-lsilver)
    424     ("\\.npmignore$"    all-the-icons-fileicon "npm"                    :face all-the-icons-dred)
    425     ("^package.json$"   all-the-icons-fileicon "npm"                    :face all-the-icons-red)
    426     ("^package.lock.json$" all-the-icons-fileicon "npm"                 :face all-the-icons-dred)
    427     ("^yarn\\.lock"     all-the-icons-fileicon "yarn"                   :face all-the-icons-blue-alt)
    428 
    429     ;; ;; AWS
    430     ("^stack.*.json$"   all-the-icons-alltheicon "aws"                  :face all-the-icons-orange)
    431 
    432 
    433     ("^serverless\\.yml$" all-the-icons-faicon "bolt"                   :v-adjust 0.0 :face all-the-icons-yellow)
    434 
    435     ;; lock files
    436     ("~$"               all-the-icons-octicon "lock"                    :v-adjust 0.0 :face all-the-icons-maroon)
    437 
    438     ;; Source Codes
    439     ("^mix.lock$"       all-the-icons-alltheicon "elixir"               :face all-the-icons-lyellow :v-adjust -0.1 :height 0.9)
    440 
    441     ("^Gemfile\\(\\.lock\\)?$" all-the-icons-alltheicon "ruby-alt"       :face all-the-icons-red)
    442     ("_?test\\.rb$"        all-the-icons-fileicon "test-ruby"            :height 1.0 :v-adjust 0.0 :face all-the-icons-red)
    443     ("_?test_helper\\.rb$" all-the-icons-fileicon "test-ruby"            :height 1.0 :v-adjust 0.0 :face all-the-icons-dred)
    444     ("_?spec\\.rb$"        all-the-icons-fileicon "test-ruby"            :height 1.0 :v-adjust 0.0 :face all-the-icons-red)
    445     ("_?spec_helper\\.rb$" all-the-icons-fileicon "test-ruby"            :height 1.0 :v-adjust 0.0 :face all-the-icons-dred)
    446 
    447     ("-?spec\\.ts$"     all-the-icons-fileicon "test-typescript"        :height 1.0 :v-adjust 0.0 :face all-the-icons-blue)
    448     ("-?test\\.ts$"     all-the-icons-fileicon "test-typescript"        :height 1.0 :v-adjust 0.0 :face all-the-icons-blue)
    449     ("-?spec\\.js$"     all-the-icons-fileicon "test-js"                :height 1.0 :v-adjust 0.0 :face all-the-icons-lpurple)
    450     ("-?test\\.js$"     all-the-icons-fileicon "test-js"                :height 1.0 :v-adjust 0.0 :face all-the-icons-lpurple)
    451     ("-?spec\\.jsx$"    all-the-icons-fileicon "test-react"             :height 1.0 :v-adjust 0.0 :face all-the-icons-blue-alt)
    452     ("-?test\\.jsx$"    all-the-icons-fileicon "test-react"             :height 1.0 :v-adjust 0.0 :face all-the-icons-blue-alt)
    453 
    454     ;; Git
    455     ("^MERGE_"          all-the-icons-octicon "git-merge"               :v-adjust 0.0 :face all-the-icons-red)
    456     ("^COMMIT_EDITMSG"  all-the-icons-octicon "git-commit"              :v-adjust 0.0 :face all-the-icons-red)
    457 
    458     ;; Stylesheeting
    459     ("stylelint"        all-the-icons-fileicon "stylelint"              :face all-the-icons-lyellow)
    460     ;; JavaScript
    461     ("^gulpfile"        all-the-icons-alltheicon "gulp"                 :height 1.0  :face all-the-icons-lred)
    462     ("^gruntfile"       all-the-icons-alltheicon "grunt"                :height 1.0 :v-adjust -0.1 :face all-the-icons-lyellow)
    463     ("^webpack"         all-the-icons-fileicon "webpack"                :face all-the-icons-lblue)
    464 
    465     ("bookmark"         all-the-icons-octicon "bookmark"                :height 1.1 :v-adjust 0.0 :face all-the-icons-lpink)
    466 
    467     ("^\\*scratch\\*$"  all-the-icons-faicon "sticky-note"              :face all-the-icons-lyellow)
    468     ("^\\*scratch.*"    all-the-icons-faicon "sticky-note"              :face all-the-icons-yellow)
    469     ("^\\*new-tab\\*$"  all-the-icons-material "star"                     :face all-the-icons-cyan)
    470 
    471     ("^\\."             all-the-icons-octicon "gear"                    :v-adjust 0.0)
    472     (".?"               all-the-icons-faicon "file-o"                   :v-adjust 0.0 :face all-the-icons-dsilver)))
    473 
    474 (defvar all-the-icons-dir-icon-alist
    475   '(
    476     ("trash"            all-the-icons-faicon "trash-o"          :height 1.2 :v-adjust -0.1)
    477     ("dropbox"          all-the-icons-faicon "dropbox"          :height 1.0 :v-adjust -0.1)
    478     ("google[ _-]drive" all-the-icons-alltheicon "google-drive" :height 1.0 :v-adjust -0.1)
    479     ("^atom$"           all-the-icons-alltheicon "atom"         :height 1.2 :v-adjust -0.1)
    480     ("documents"        all-the-icons-faicon "book"             :height 1.0 :v-adjust -0.1)
    481     ("download"         all-the-icons-faicon "cloud-download"   :height 0.9 :v-adjust -0.1)
    482     ("desktop"          all-the-icons-octicon "device-desktop"  :height 1.0 :v-adjust -0.1)
    483     ("pictures"         all-the-icons-faicon "picture-o"        :height 0.9 :v-adjust -0.2)
    484     ("photos"           all-the-icons-faicon "camera-retro"     :height 1.0 :v-adjust -0.1)
    485     ("music"            all-the-icons-faicon "music"            :height 1.0 :v-adjust -0.1)
    486     ("movies"           all-the-icons-faicon "film"             :height 0.9 :v-adjust -0.1)
    487     ("code"             all-the-icons-octicon "code"            :height 1.1 :v-adjust -0.1)
    488     ("workspace"        all-the-icons-octicon "code"            :height 1.1 :v-adjust -0.1)
    489     ("test"             all-the-icons-fileicon "test-dir"       :height 0.9)
    490     ("\\.git"           all-the-icons-alltheicon "git"          :height 1.0)
    491     (".?"               all-the-icons-octicon "file-directory"  :height 1.0 :v-adjust -0.1)
    492     ))
    493 
    494 (defvar all-the-icons-weather-icon-alist
    495   '(
    496     ("tornado"               all-the-icons-wicon "tornado")
    497     ("hurricane"             all-the-icons-wicon "hurricane")
    498     ("thunderstorms"         all-the-icons-wicon "thunderstorm")
    499     ("sunny"                 all-the-icons-wicon "day-sunny")
    500     ("rain.*snow"            all-the-icons-wicon "rain-mix")
    501     ("rain.*hail"            all-the-icons-wicon "rain-mix")
    502     ("sleet"                 all-the-icons-wicon "sleet")
    503     ("hail"                  all-the-icons-wicon "hail")
    504     ("drizzle"               all-the-icons-wicon "sprinkle")
    505     ("rain"                  all-the-icons-wicon "showers" :height 1.1 :v-adjust 0.0)
    506     ("showers"               all-the-icons-wicon "showers")
    507     ("blowing.*snow"         all-the-icons-wicon "snow-wind")
    508     ("snow"                  all-the-icons-wicon "snow")
    509     ("dust"                  all-the-icons-wicon "dust")
    510     ("fog"                   all-the-icons-wicon "fog")
    511     ("haze"                  all-the-icons-wicon "day-haze")
    512     ("smoky"                 all-the-icons-wicon "smoke")
    513     ("blustery"              all-the-icons-wicon "cloudy-windy")
    514     ("windy"                 all-the-icons-wicon "cloudy-gusts")
    515     ("cold"                  all-the-icons-wicon "snowflake-cold")
    516     ("partly.*cloudy.*night" all-the-icons-wicon "night-alt-partly-cloudy")
    517     ("partly.*cloudy"        all-the-icons-wicon "day-cloudy-high")
    518     ("cloudy.*night"         all-the-icons-wicon "night-alt-cloudy")
    519     ("cxloudy.*day"          all-the-icons-wicon "day-cloudy")
    520     ("cloudy"                all-the-icons-wicon "cloudy")
    521     ("clear.*night"          all-the-icons-wicon "night-clear")
    522     ("fair.*night"           all-the-icons-wicon "stars")
    523     ("fair.*day"             all-the-icons-wicon "horizon")
    524     ("hot"                   all-the-icons-wicon "hot")
    525     ("not.*available"        all-the-icons-wicon "na")
    526     ))
    527 
    528 (defvar all-the-icons-mode-icon-alist
    529   '(
    530     (emacs-lisp-mode           all-the-icons-fileicon "elisp"              :height 1.0 :v-adjust -0.1 :face all-the-icons-purple)
    531     (circe-server-mode         all-the-icons-faicon "commenting-o"         :height 1.0 :v-adjust 0.0)
    532     (circe-channel-mode        all-the-icons-faicon "commenting-o"         :height 1.0 :v-adjust 0.0)
    533     (erc-mode                  all-the-icons-faicon "commenting-o"         :height 1.0 :v-adjust 0.0)
    534     (inferior-emacs-lisp-mode  all-the-icons-fileicon "elisp"              :height 1.0 :v-adjust -0.1 :face all-the-icons-lblue)
    535     (dired-mode                all-the-icons-octicon "file-directory"      :v-adjust 0.0)
    536     (lisp-interaction-mode     all-the-icons-fileicon "lisp"               :v-adjust -0.1 :face all-the-icons-orange)
    537     (sly-mrepl-mode            all-the-icons-fileicon "clisp"               :v-adjust -0.1 :face all-the-icons-orange)
    538     (slime-repl-mode           all-the-icons-fileicon "clisp"               :v-adjust -0.1 :face all-the-icons-orange)
    539     (org-mode                  all-the-icons-fileicon "org"                :v-adjust 0.0 :face all-the-icons-lgreen)
    540     (typescript-mode           all-the-icons-fileicon "typescript"         :v-adjust -0.1 :face all-the-icons-blue-alt)
    541     (js-mode                   all-the-icons-alltheicon "javascript"       :v-adjust -0.1 :face all-the-icons-yellow)
    542     (js-jsx-mode               all-the-icons-alltheicon "javascript"       :v-adjust -0.1 :face all-the-icons-yellow)
    543     (js2-mode                  all-the-icons-alltheicon "javascript"       :v-adjust -0.1 :face all-the-icons-yellow)
    544     (js3-mode                  all-the-icons-alltheicon "javascript"       :v-adjust -0.1 :face all-the-icons-yellow)
    545     (rjsx-mode                 all-the-icons-fileicon "jsx-2"              :v-adjust -0.1 :face all-the-icons-cyan-alt)
    546     (term-mode                 all-the-icons-octicon "terminal"            :v-adjust 0.2)
    547     (vterm-mode                all-the-icons-octicon "terminal"            :v-adjust 0.2)
    548     (eshell-mode               all-the-icons-octicon "terminal"            :v-adjust 0.0 :face all-the-icons-purple)
    549     (magit-refs-mode           all-the-icons-octicon "git-branch"          :v-adjust 0.0 :face all-the-icons-red)
    550     (magit-process-mode        all-the-icons-octicon "mark-github"         :v-adjust 0.0)
    551     (magit-diff-mode           all-the-icons-octicon "git-compare"         :v-adjust 0.0 :face all-the-icons-lblue)
    552     (ediff-mode                all-the-icons-octicon "git-compare"         :v-adjust 0.0 :Face all-the-icons-red)
    553     (comint-mode               all-the-icons-faicon "terminal"             :v-adjust 0.0 :face all-the-icons-lblue)
    554     (eww-mode                  all-the-icons-faicon "firefox"              :v-adjust -0.1 :face all-the-icons-red)
    555     (org-agenda-mode           all-the-icons-octicon "checklist"           :v-adjust 0.0 :face all-the-icons-lgreen)
    556     (cfw:calendar-mode         all-the-icons-octicon "calendar"            :v-adjust 0.0)
    557     (ibuffer-mode              all-the-icons-faicon "files-o"              :v-adjust 0.0 :face all-the-icons-dsilver)
    558     (messages-buffer-mode      all-the-icons-faicon "file-o"               :v-adjust 0.0 :face all-the-icons-dsilver)
    559     (help-mode                 all-the-icons-faicon "info"                 :v-adjust -0.1 :face all-the-icons-purple)
    560     (benchmark-init/tree-mode  all-the-icons-octicon "dashboard"           :v-adjust 0.0)
    561     (jenkins-mode              all-the-icons-fileicon "jenkins"            :face all-the-icons-blue)
    562     (magit-popup-mode          all-the-icons-alltheicon "git"              :face all-the-icons-red)
    563     (magit-status-mode         all-the-icons-alltheicon "git"              :face all-the-icons-lred)
    564     (magit-log-mode            all-the-icons-alltheicon "git"              :face all-the-icons-green)
    565     (mu4e-compose-mode         all-the-icons-octicon "pencil"              :v-adjust 0.0)
    566     (mu4e-headers-mode         all-the-icons-octicon "mail"                :v-adjust 0.0)
    567     (mu4e-main-mode            all-the-icons-octicon "mail"                :v-adjust 0.0)
    568     (mu4e-view-mode            all-the-icons-octicon "mail-read"           :v-adjust 0.0)
    569     (package-menu-mode         all-the-icons-faicon "archive"              :height 1.0 :v-adjust 0.0 :face all-the-icons-silver)
    570     (paradox-menu-mode         all-the-icons-faicon "archive"              :height 1.0 :v-adjust 0.0 :face all-the-icons-silver)
    571     (Custom-mode               all-the-icons-octicon "settings"            :v-adjust -0.1)
    572 
    573     ;; Special matcher for Web Mode based on the `web-mode-content-type' of the current buffer
    574     (web-mode             all-the-icons--web-mode-icon)
    575 
    576     (fundamental-mode                   all-the-icons-fileicon "elisp"            :height 1.0 :v-adjust -0.1 :face all-the-icons-dsilver)
    577     (special-mode                       all-the-icons-fileicon "elisp"            :height 1.0 :v-adjust -0.1 :face all-the-icons-yellow)
    578     (text-mode                          all-the-icons-octicon "file-text"         :v-adjust 0.0 :face all-the-icons-cyan)
    579     (enh-ruby-mode                      all-the-icons-alltheicon "ruby-alt"       :face all-the-icons-lred)
    580     (ruby-mode                          all-the-icons-alltheicon "ruby-alt"       :face all-the-icons-lred)
    581     (inf-ruby-mode                      all-the-icons-alltheicon "ruby-alt"       :face all-the-icons-red)
    582     (projectile-rails-compilation-mode  all-the-icons-alltheicon "ruby-alt"       :face all-the-icons-red)
    583     (rspec-compilation-mode             all-the-icons-alltheicon "ruby-alt"       :face all-the-icons-red)
    584     (rake-compilation-mode              all-the-icons-alltheicon "ruby-alt"       :face all-the-icons-red)
    585     (sh-mode                            all-the-icons-alltheicon "terminal"       :face all-the-icons-purple)
    586     (shell-mode                         all-the-icons-alltheicon "terminal"       :face all-the-icons-purple)
    587     (fish-mode                          all-the-icons-alltheicon "terminal"       :face all-the-icons-lpink)
    588     (nginx-mode                         all-the-icons-fileicon "nginx"            :height 0.9  :face all-the-icons-dgreen)
    589     (apache-mode                        all-the-icons-alltheicon "apache"         :height 0.9  :face all-the-icons-dgreen)
    590     (makefile-mode                      all-the-icons-fileicon "gnu"              :face all-the-icons-dorange)
    591     (cmake-mode                         all-the-icons-fileicon "cmake"            :face all-the-icons-red)
    592     (dockerfile-mode                    all-the-icons-fileicon "dockerfile"       :face all-the-icons-blue)
    593     (docker-compose-mode                all-the-icons-fileicon "dockerfile"       :face all-the-icons-lblue)
    594     (nxml-mode                          all-the-icons-faicon "file-code-o"        :height 0.95 :face all-the-icons-lorange)
    595     (json-mode                          all-the-icons-octicon "settings"          :face all-the-icons-yellow)
    596     (yaml-mode                          all-the-icons-octicon "settings"          :v-adjust 0.0 :face all-the-icons-dyellow)
    597     (elisp-byte-code-mode               all-the-icons-octicon "file-binary"       :v-adjust 0.0 :face all-the-icons-dsilver)
    598     (archive-mode                       all-the-icons-octicon "file-zip"          :v-adjust 0.0 :face all-the-icons-lmaroon)
    599     (elm-mode                           all-the-icons-fileicon "elm"              :face all-the-icons-blue)
    600     (erlang-mode                        all-the-icons-alltheicon "erlang"         :face all-the-icons-red :v-adjust -0.1 :height 0.9)
    601     (elixir-mode                        all-the-icons-alltheicon "elixir"         :face all-the-icons-lorange :v-adjust -0.1 :height 0.9)
    602     (java-mode                          all-the-icons-alltheicon "java"           :height 1.0  :face all-the-icons-purple)
    603     (go-mode                            all-the-icons-fileicon "go"               :height 1.0  :face all-the-icons-blue)
    604     (matlab-mode                        all-the-icons-fileicon "matlab"           :face all-the-icons-orange)
    605     (perl-mode                          all-the-icons-alltheicon "perl"           :face all-the-icons-lorange)
    606     (cperl-mode                         all-the-icons-alltheicon "perl"           :face all-the-icons-lorange)
    607     (php-mode                           all-the-icons-fileicon "php"              :face all-the-icons-lsilver)
    608     (prolog-mode                        all-the-icons-alltheicon "prolog"         :height 1.1  :face all-the-icons-lmaroon)
    609     (python-mode                        all-the-icons-alltheicon "python"         :height 1.0  :face all-the-icons-dblue)
    610     (inferior-python-mode               all-the-icons-alltheicon "python"         :height 1.0  :face all-the-icons-dblue)
    611     (racket-mode                        all-the-icons-fileicon "racket"           :height 1.2 :face all-the-icons-red)
    612     (rust-mode                          all-the-icons-alltheicon "rust"           :height 1.2  :face all-the-icons-maroon)
    613     (scala-mode                         all-the-icons-alltheicon "scala"          :face all-the-icons-red)
    614     (scheme-mode                        all-the-icons-fileicon   "scheme"         :height 1.2 :face all-the-icons-red)
    615     (swift-mode                         all-the-icons-alltheicon "swift"          :height 1.0 :v-adjust -0.1 :face all-the-icons-green)
    616     (c-mode                             all-the-icons-alltheicon "c-line"         :face all-the-icons-blue)
    617     (c++-mode                           all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-blue)
    618     (csharp-mode                        all-the-icons-alltheicon "csharp-line"    :face all-the-icons-dblue)
    619     (clojure-mode                       all-the-icons-alltheicon "clojure"        :height 1.0  :face all-the-icons-blue)
    620     (cider-repl-mode                    all-the-icons-alltheicon "clojure"        :height 1.0  :face all-the-icons-green)
    621     (clojurescript-mode                 all-the-icons-fileicon "cljs"             :height 1.0  :face all-the-icons-dblue)
    622     (coffee-mode                        all-the-icons-alltheicon "coffeescript"   :height 1.0  :face all-the-icons-maroon)
    623     (lisp-mode                          all-the-icons-fileicon "lisp"             :face all-the-icons-orange)
    624     (css-mode                           all-the-icons-alltheicon "css3"           :face all-the-icons-yellow)
    625     (scss-mode                          all-the-icons-alltheicon "sass"           :face all-the-icons-pink)
    626     (sass-mode                          all-the-icons-alltheicon "sass"           :face all-the-icons-dpink)
    627     (less-css-mode                      all-the-icons-alltheicon "less"           :height 0.8  :face all-the-icons-dyellow)
    628     (stylus-mode                        all-the-icons-alltheicon "stylus"         :face all-the-icons-lgreen)
    629     (csv-mode                           all-the-icons-octicon "graph"             :v-adjust 0.0 :face all-the-icons-dblue)
    630     (haskell-mode                       all-the-icons-alltheicon "haskell"        :height 1.0  :face all-the-icons-red)
    631     (haskell-c2hs-mode                  all-the-icons-alltheicon "haskell"        :height 1.0  :face all-the-icons-red)
    632     (literate-haskell-mode              all-the-icons-alltheicon "haskell"        :height 1.0  :face all-the-icons-red)
    633     (haml-mode                          all-the-icons-fileicon "haml"             :face all-the-icons-lyellow)
    634     (html-mode                          all-the-icons-alltheicon "html5"          :face all-the-icons-orange)
    635     (rhtml-mode                         all-the-icons-alltheicon "html5"          :face all-the-icons-lred)
    636     (mustache-mode                      all-the-icons-fileicon "moustache"        :face all-the-icons-green)
    637     (slim-mode                          all-the-icons-octicon "dashboard"         :v-adjust 0.0 :face all-the-icons-yellow)
    638     (jade-mode                          all-the-icons-fileicon "jade"             :face all-the-icons-red)
    639     (pug-mode                           all-the-icons-fileicon "pug"              :face all-the-icons-red)
    640     (react-mode                         all-the-icons-alltheicon "react"          :height 1.1  :face all-the-icons-lblue)
    641     (image-mode                         all-the-icons-octicon "file-media"        :v-adjust 0.0 :face all-the-icons-blue)
    642     (texinfo-mode                       all-the-icons-fileicon "tex"              :face all-the-icons-lred)
    643     (markdown-mode                      all-the-icons-octicon "markdown"          :v-adjust 0.0 :face all-the-icons-lblue)
    644     (bibtex-mode                        all-the-icons-fileicon "bib"              :face all-the-icons-maroon)
    645     (org-mode                           all-the-icons-fileicon "org"              :face all-the-icons-lgreen)
    646     (compilation-mode                   all-the-icons-faicon "cogs"               :v-adjust 0.0 :height 1.0)
    647     (objc-mode                          all-the-icons-faicon "apple"              :v-adjust 0.0 :height 1.0)
    648     (tuareg-mode                        all-the-icons-fileicon "ocaml"            :v-adjust 0.0 :height 1.0)
    649     (purescript-mode                    all-the-icons-fileicon "purescript"       :v-adjust 0.0 :height 1.0)
    650     (verilog-mode                       all-the-icons-fileicon "verilog"          :height 1.0 :v-adjust -0.2 :face all-the-icons-red)
    651     (vhdl-mode                          all-the-icons-fileicon "vhdl"             :face all-the-icons-blue)
    652     (haskell-cabal-mode                 all-the-icons-fileicon "cabal"            :face all-the-icons-lblue)
    653     (kotlin-mode                        all-the-icons-fileicon "kotlin"           :face all-the-icons-orange)
    654     (nim-mode                           all-the-icons-fileicon "nimrod"           :face all-the-icons-yellow)
    655     (sql-mode                           all-the-icons-octicon  "database"         :face all-the-icons-silver)
    656     (lua-mode                           all-the-icons-fileicon "lua"              :face all-the-icons-dblue)
    657     (adoc-mode                          all-the-icons-fileicon "asciidoc"         :face all-the-icons-lblue)
    658     (puppet-mode                        all-the-icons-fileicon "puppet"           :face all-the-icons-yellow)
    659     (jinja2-mode                        all-the-icons-fileicon "jinja"            :face all-the-icons-silver)
    660     (powershell-mode                    all-the-icons-fileicon "powershell"       :face all-the-icons-blue)
    661     (tex-mode                           all-the-icons-fileicon "tex"              :face all-the-icons-lred)
    662     (latex-mode                         all-the-icons-fileicon "tex"              :face all-the-icons-lred)
    663     (dart-mode                          all-the-icons-fileicon "dart"             :height 1.0  :face all-the-icons-blue)
    664     (fsharp-mode                        all-the-icons-fileicon "fsharp"           :height 1.0  :face all-the-icons-blue)
    665     (asm-mode                           all-the-icons-fileicon "assembly"         :height 1.0  :face all-the-icons-blue)
    666     (nasm-mode                          all-the-icons-fileicon "assembly"         :height 1.0  :face all-the-icons-blue)
    667     (tcl-mode                           all-the-icons-fileicon "tcl"              :height 1.0  :face all-the-icons-dred)
    668     (cuda-mode                          all-the-icons-fileicon "nvidia"           :face all-the-icons-green)
    669     (glsl-mode                          all-the-icons-fileicon "vertex-shader"    :face all-the-icons-green)
    670     (zig-mode                           all-the-icons-fileicon "zig"              :face all-the-icons-orange)))
    671 
    672 (defvar all-the-icons-url-alist
    673   '(
    674     ;; Social media and communities
    675     ("^\\(https?://\\)?\\(www\\.\\)?del\\.icio\\.us" all-the-icons-faicon "delicious")
    676     ("^\\(https?://\\)?\\(www\\.\\)?behance\\.net" all-the-icons-faicon "behance")
    677     ("^\\(https?://\\)?\\(www\\.\\)?dribbble\\.com" all-the-icons-faicon "dribbble")
    678     ("^\\(https?://\\)?\\(www\\.\\)?facebook\\.com" all-the-icons-faicon "facebook-official")
    679     ("^\\(https?://\\)?\\(www\\.\\)?glide\\.me" all-the-icons-faicon "glide-g")
    680     ("^\\(https?://\\)?\\(www\\.\\)?plus\\.google\\.com" all-the-icons-faicon "google-plus")
    681     ("linkedin\\.com" all-the-icons-faicon "linkedin")
    682     ("^\\(https?://\\)?\\(www\\.\\)?ok\\.ru" all-the-icons-faicon "odnoklassniki")
    683     ("^\\(https?://\\)?\\(www\\.\\)?reddit\\.com" all-the-icons-faicon "reddit-alien")
    684     ("^\\(https?://\\)?\\(www\\.\\)?slack\\.com" all-the-icons-faicon "slack")
    685     ("^\\(https?://\\)?\\(www\\.\\)?snapchat\\.com" all-the-icons-faicon "snapchat-ghost")
    686     ("^\\(https?://\\)?\\(www\\.\\)?weibo\\.com" all-the-icons-faicon "weibo")
    687     ("^\\(https?://\\)?\\(www\\.\\)?twitter\\.com" all-the-icons-faicon "twitter")
    688     ;; Blogging
    689     ("joomla\\.org" all-the-icons-faicon "joomla")
    690     ("^\\(https?://\\)?\\(www\\.\\)?medium\\.com" all-the-icons-faicon "medium")
    691     ("tumblr\\.com" all-the-icons-faicon "tumblr")
    692     ("^wordpress\\.com" all-the-icons-faicon "wordpress")
    693     ;; Programming
    694     ("^\\(https?://\\)?\\(www\\.\\)?bitbucket\\.org" all-the-icons-faicon "bitbucket")
    695     ("^\\(https?://\\)?\\(www\\.\\)?codepen\\.io" all-the-icons-faicon "codepen")
    696     ("^\\(https?://\\)?\\(www\\.\\)?codiepie\\.com" all-the-icons-faicon "codiepie")
    697     ("^\\(https?://\\)?\\(www\\.\\)?gist\\.github\\.com" all-the-icons-octicon "gist")
    698     ("^\\(https?://\\)?\\(www\\.\\)?github\\.com" all-the-icons-octicon "mark-github")
    699     ("^\\(https?://\\)?\\(www\\.\\)?gitlab\\.com" all-the-icons-faicon "gitlab")
    700     ("^\\(https?://\\)?\\(www\\.\\)?news\\.ycombinator\\.com" all-the-icons-faicon "hacker-news")
    701     ("^\\(https?://\\)?\\(www\\.\\)?jsfiddle\\.net" all-the-icons-faicon "jsfiddle")
    702     ("^\\(https?://\\)?\\(www\\.\\)?maxcdn\\.com" all-the-icons-faicon "maxcdn")
    703     ("^\\(https?://\\)?\\(www\\.\\)?stackoverflow\\.com" all-the-icons-faicon "stack-overflow")
    704     ;; Video
    705     ("^\\(https?://\\)?\\(www\\.\\)?twitch\\.tv" all-the-icons-faicon "twitch")
    706     ("^\\(https?://\\)?\\(www\\.\\)?vimeo\\.com" all-the-icons-faicon "vimeo")
    707     ("^\\(https?://\\)?\\(www\\.\\)?youtube\\.com" all-the-icons-faicon "youtube")
    708     ("^\\(https?://\\)?\\(www\\.\\)?youtu\\.be" all-the-icons-faicon "youtube")
    709     ("^\\(https?://\\)?\\(www\\.\\)?vine\\.co" all-the-icons-faicon "vine")
    710     ;; Sound
    711     ("^\\(https?://\\)?\\(www\\.\\)?last\\.fm" all-the-icons-faicon "lastfm")
    712     ("^\\(https?://\\)?\\(www\\.\\)?mixcloud\\.com" all-the-icons-faicon "mixcloud")
    713     ("^\\(https?://\\)?\\(www\\.\\)?soundcloud\\.com" all-the-icons-faicon "soundcloud")
    714     ("spotify\\.com" all-the-icons-faicon "spotify")
    715     ;; Shopping
    716     ("^\\(https?://\\)?\\(www\\.\\)?amazon\\." all-the-icons-faicon "amazon")
    717     ("^\\(https?://\\)?\\(www\\.\\)?opencart\\.com" all-the-icons-faicon "opencart")
    718     ("^\\(https?://\\)?\\(www\\.\\)?paypal\\.com" all-the-icons-faicon "paypal")
    719     ("^\\(https?://\\)?\\(www\\.\\)?shirtsinbulk\\.com" all-the-icons-faicon "shitsinbulk")
    720     ;; Images
    721     ("^\\(https?://\\)?\\(www\\.\\)?500px\\.com" all-the-icons-faicon "500px")
    722     ("^\\(https?://\\)?\\(www\\.\\)?deviantart\\.com" all-the-icons-faicon "deviantart")
    723     ("^\\(https?://\\)?\\(www\\.\\)?flickr\\.com" all-the-icons-faicon "flickr")
    724     ("^\\(https?://\\)?\\(www\\.\\)?instagram\\.com" all-the-icons-faicon "instagram")
    725     ("^\\(https?://\\)?\\(www\\.\\)?pinterest\\." all-the-icons-faicon "pinterest")
    726     ;; Information and books
    727     ("^\\(https?://\\)?\\(www\\.\\)?digg\\.com" all-the-icons-faicon "digg")
    728     ("^\\(https?://\\)?\\(www\\.\\)?foursquare\\.com" all-the-icons-faicon "foursquare")
    729     ("^\\(https?://\\)?\\(www\\.\\)?getpocket\\.com" all-the-icons-faicon "get-pocket")
    730     ("^\\(https?://\\)?\\(www\\.\\)?scribd\\.com" all-the-icons-faicon "scribd")
    731     ("^\\(https?://\\)?\\(www\\.\\)?slideshare\\.net" all-the-icons-faicon "slideshare")
    732     ("stackexchange\\.com" all-the-icons-faicon "stack-exchange")
    733     ("^\\(https?://\\)?\\(www\\.\\)?stumbleupon\\.com" all-the-icons-faicon "stumbleupon")
    734     ("^\\(https?://\\)?\\(www\\.\\)?tripadvisor\\." all-the-icons-faicon "tripadvisor")
    735     ("^\\(https?://\\)?\\(www\\.\\)?yelp\\." all-the-icons-faicon "yelp")
    736 
    737     ("wikipedia\\.org" all-the-icons-faicon "wikipedia-w")
    738     ;; Various companies and tools
    739     ("^\\(https?://\\)?\\(www\\.\\)?angel\\.co" all-the-icons-faicon "angellist")
    740     ("^\\(https?://\\)?\\(www\\.\\)?apple\\.com" all-the-icons-faicon "apple")
    741     ("^\\(https?://\\)?\\(www\\.\\)?buysellads\\.com" all-the-icons-faicon "buysellads")
    742     ("^\\(https?://\\)?\\(www\\.\\)?connectdevelop\\.com" all-the-icons-faicon "connectdevelop")
    743     ("^\\(https?://\\)?\\(www\\.\\)?dashcube\\.com" all-the-icons-faicon "dashcube")
    744     ("^\\(https?://\\)?\\(www\\.\\)?dropbox\\.com" all-the-icons-faicon "dropbox")
    745     ("^\\(https?://\\)?\\(www\\.\\)?enviragallery\\.com" all-the-icons-faicon "envira")
    746     ("^\\(https?://\\)?\\(www\\.\\)?fortawesome\\.com" all-the-icons-faicon "fort-awesome")
    747     ("^\\(https?://\\)?\\(www\\.\\)?forumbee\\.com" all-the-icons-faicon "forumbee")
    748     ("^\\(https?://\\)?\\(www\\.\\)?gratipay\\.com" all-the-icons-faicon "gratipay")
    749     ("^\\(https?://\\)?\\(www\\.\\)?modx\\.com" all-the-icons-faicon "modx")
    750     ("^\\(https?://\\)?\\(www\\.\\)?pagelines\\.com" all-the-icons-faicon "pagelines")
    751     ("^\\(https?://\\)?\\(www\\.\\)?producthunt\\.com" all-the-icons-faicon "product-hunt")
    752     ("sellsy\\.com" all-the-icons-faicon "sellsy")
    753     ("^\\(https?://\\)?\\(www\\.\\)?simplybuilt\\.com" all-the-icons-faicon "simplybuilt")
    754     ("^\\(https?://\\)?\\(www\\.\\)?skyatlas\\.com" all-the-icons-faicon "skyatlas")
    755     ("^\\(https?://\\)?\\(www\\.\\)?skype\\.com" all-the-icons-faicon "skype")
    756     ("steampowered\\.com" all-the-icons-faicon "steam")
    757     ("^\\(https?://\\)?\\(www\\.\\)?themeisle\\.com" all-the-icons-faicon "themeisle")
    758     ("^\\(https?://\\)?\\(www\\.\\)?trello\\.com" all-the-icons-faicon "trello")
    759     ("^\\(https?://\\)?\\(www\\.\\)?whatsapp\\.com" all-the-icons-faicon "whatsapp")
    760     ("^\\(https?://\\)?\\(www\\.\\)?ycombinator\\.com" all-the-icons-faicon "y-combinator")
    761     ("yahoo\\.com" all-the-icons-faicon "yahoo")
    762     ("^\\(https?://\\)?\\(www\\.\\)?yoast\\.com" all-the-icons-faicon "yoast")
    763     ;; Catch all
    764     ("android" all-the-icons-faicon "android")
    765     ("creativecommons" all-the-icons-faicon "creative-commons")
    766     ("forums?" all-the-icons-octicon "comment-discussion")
    767     ("\\.pdf$" all-the-icons-octicon "file-pdf" :v-adjust 0.0 :face all-the-icons-dred)
    768     ("google" all-the-icons-faicon "google")
    769     ("\\.rss" all-the-icons-faicon "rss")
    770     ))
    771 
    772 ;; ====================
    773 ;;   Functions Start
    774 ;; ====================
    775 
    776 (defun all-the-icons-auto-mode-match? (&optional file)
    777   "Whether or not FILE's `major-mode' match against its `auto-mode-alist'."
    778   (let* ((file (or file (buffer-file-name) (buffer-name)))
    779          (auto-mode (all-the-icons-match-to-alist file auto-mode-alist)))
    780     (eq major-mode auto-mode)))
    781 
    782 (defun all-the-icons-match-to-alist (file alist)
    783   "Match FILE against an entry in ALIST using `string-match'."
    784   (cdr (cl-find-if (lambda (it) (string-match (car it) file)) alist)))
    785 
    786 (defun all-the-icons-dir-is-submodule (dir)
    787   "Checker whether or not DIR is a git submodule."
    788   (let* ((gitmodule-dir (locate-dominating-file dir ".gitmodules"))
    789          (modules-file  (expand-file-name (format "%s.gitmodules" gitmodule-dir)))
    790          (module-search (format "submodule \".*?%s\"" (file-name-base dir))))
    791 
    792     (when (and gitmodule-dir (file-exists-p (format "%s/.git" dir)))
    793       (with-temp-buffer
    794         (insert-file-contents modules-file)
    795         (search-forward-regexp module-search (point-max) t)))))
    796 
    797 ;; Icon functions
    798 (defun all-the-icons-icon-for-dir-with-chevron (dir &optional chevron padding)
    799   "Format an icon for DIR with CHEVRON similar to tree based directories.
    800 
    801 If PADDING is provided, it will prepend and separate the chevron
    802 and directory with PADDING.
    803 
    804 Produces different symbols by inspecting DIR to distinguish
    805 symlinks and git repositories which do not depend on the
    806 directory contents"
    807   (let ((icon (all-the-icons-icon-for-dir dir))
    808         (chevron (if chevron (all-the-icons-octicon (format "chevron-%s" chevron) :height 0.8 :v-adjust -0.1) ""))
    809         (padding (or padding "\t")))
    810     (format "%s%s%s%s%s" padding chevron padding icon padding)))
    811 
    812 (defun all-the-icons-icon-for-buffer ()
    813   "Get the formatted icon for the current buffer.
    814 
    815 This function prioritises the use of the buffers file extension to
    816 discern the icon when its `major-mode' matches its auto mode,
    817 otherwise it will use the buffers `major-mode' to decide its
    818 icon."
    819   (all-the-icons--icon-info-for-buffer))
    820 
    821 (defun all-the-icons-icon-family-for-buffer ()
    822   "Get the icon font family for the current buffer."
    823   (all-the-icons--icon-info-for-buffer "family"))
    824 
    825 (defun all-the-icons--web-mode-icon (&rest arg-overrides) "Get icon for a `web-mode' buffer with ARG-OVERRIDES." (all-the-icons--web-mode nil arg-overrides))
    826 (defun all-the-icons--web-mode-icon-family () "Get icon family for a `web-mode' buffer." (all-the-icons--web-mode t))
    827 (defun all-the-icons--web-mode (&optional family arg-overrides)
    828   "Return icon or FAMILY for `web-mode' based on `web-mode-content-type'.
    829 Providing ARG-OVERRIDES will modify the creation of the icon."
    830   (let ((non-nil-args (cl-reduce (lambda (acc it) (if it (append acc (list it)) acc)) arg-overrides :initial-value '())))
    831     (cond
    832      ((equal web-mode-content-type "jsx")
    833       (if family (all-the-icons-fileicon-family) (apply 'all-the-icons-fileicon (append '("jsx-2") non-nil-args))))
    834      ((equal web-mode-content-type "javascript")
    835       (if family (all-the-icons-alltheicon-family) (apply 'all-the-icons-alltheicon (append '("javascript") non-nil-args))))
    836      ((equal web-mode-content-type "json")
    837       (if family (all-the-icons-alltheicon-family) (apply 'all-the-icons-alltheicon (append '("less") non-nil-args))))
    838      ((equal web-mode-content-type "xml")
    839       (if family (all-the-icons-faicon-family) (apply 'all-the-icons-faicon (append '("file-code-o") non-nil-args))))
    840      ((equal web-mode-content-type "css")
    841       (if family (all-the-icons-alltheicon-family) (apply 'all-the-icons-alltheicon (append '("css3") non-nil-args))))
    842      (t
    843       (if family (all-the-icons-alltheicon-family) (apply 'all-the-icons-alltheicon (append '("html5") non-nil-args)))))))
    844 
    845 ;; Icon Functions
    846 
    847 ;;;###autoload
    848 (defun all-the-icons-icon-for-dir (dir &rest arg-overrides)
    849   "Get the formatted icon for DIR.
    850 ARG-OVERRIDES should be a plist containining `:height',
    851 `:v-adjust' or `:face' properties like in the normal icon
    852 inserting functions.
    853 
    854 Note: You want chevron, please use `all-the-icons-icon-for-dir-with-chevron'."
    855   (let* ((dirname (file-name-base (directory-file-name dir)))
    856          (path (expand-file-name dir))
    857          (icon (all-the-icons-match-to-alist dirname all-the-icons-dir-icon-alist))
    858          (args (cdr icon)))
    859     (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
    860     (cond
    861      ((file-symlink-p path)
    862       (apply #'all-the-icons-octicon "file-symlink-directory" (cdr args)))
    863      ((all-the-icons-dir-is-submodule path)
    864       (apply #'all-the-icons-octicon "file-submodule" (cdr args)))
    865      ((file-exists-p (format "%s/.git" path))
    866       (apply #'all-the-icons-octicon "repo" (cdr args)))
    867      (t (apply (car icon) args)))))
    868 
    869 ;;;###autoload
    870 (defun all-the-icons-icon-for-file (file &rest arg-overrides)
    871   "Get the formatted icon for FILE.
    872 ARG-OVERRIDES should be a plist containining `:height',
    873 `:v-adjust' or `:face' properties like in the normal icon
    874 inserting functions."
    875   (let* ((ext (file-name-extension file))
    876          (icon (or (and ext
    877                         (cdr (assoc (downcase ext)
    878                                     all-the-icons-extension-icon-alist)))
    879                    (all-the-icons-match-to-alist file all-the-icons-regexp-icon-alist)))
    880          (args (cdr icon)))
    881     (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
    882     (apply (car icon) args)))
    883 
    884 ;;;###autoload
    885 (defun all-the-icons-icon-for-mode (mode &rest arg-overrides)
    886   "Get the formatted icon for MODE.
    887 ARG-OVERRIDES should be a plist containining `:height',
    888 `:v-adjust' or `:face' properties like in the normal icon
    889 inserting functions."
    890   (let* ((icon (cdr (or (assoc mode all-the-icons-mode-icon-alist)
    891                         (assoc (get mode 'derived-mode-parent) all-the-icons-mode-icon-alist))))
    892          (args (cdr icon)))
    893     (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
    894     (if icon (apply (car icon) args) mode)))
    895 
    896 ;;;###autoload
    897 (defun all-the-icons-icon-for-url (url &rest arg-overrides)
    898   "Get the formatted icon for URL.
    899 If an icon for URL isn't found in `all-the-icons-url-alist', a globe is used.
    900 ARG-OVERRIDES should be a plist containining `:height',
    901 `:v-adjust' or `:face' properties like in the normal icon
    902 inserting functions."
    903   (let* ((icon (all-the-icons-match-to-alist url all-the-icons-url-alist))
    904          (args (cdr icon)))
    905     (unless icon
    906       (setq icon '(all-the-icons-faicon "globe"))
    907       (setq args (cdr icon)))
    908     (when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
    909     (apply (car icon) args)))
    910 
    911 (defcustom all-the-icons--cache-limit 2048
    912   "Maximum cache size for functions cached by `all-the-icons-cache'."
    913   :type 'integer)
    914 
    915 (defun all-the-icons-cache (func)
    916   "Set a cache for FUNC. Does not work on interactive functions."
    917   (unless (get func 'all-the-icons--cached)
    918     (let ((cache (make-hash-table :test #'equal
    919                                   :size all-the-icons--cache-limit))
    920           (orig-fn (symbol-function func)))
    921       (fset func
    922             (lambda (&rest args)
    923               (or (gethash args cache)
    924                   (progn
    925                     (when (> (hash-table-count cache)
    926                              all-the-icons--cache-limit)
    927                       (clrhash cache))
    928                     (puthash args (apply orig-fn args) cache)))))))
    929 
    930   (put func 'all-the-icons--cached t))
    931 
    932 (all-the-icons-cache #'all-the-icons-icon-for-dir)
    933 (all-the-icons-cache #'all-the-icons-icon-for-file)
    934 (all-the-icons-cache #'all-the-icons-icon-for-mode)
    935 (all-the-icons-cache #'all-the-icons-icon-for-url)
    936 
    937 ;; Family Face Functions
    938 (defun all-the-icons-icon-family-for-file (file)
    939   "Get the icons font family for FILE."
    940   (let ((icon (all-the-icons-match-to-alist file all-the-icons-regexp-icon-alist)))
    941     (funcall (intern (format "%s-family" (car icon))))))
    942 
    943 (defun all-the-icons-icon-family-for-mode (mode)
    944   "Get the icons font family for MODE."
    945   (let ((icon (cdr (assoc mode all-the-icons-mode-icon-alist))))
    946     (if icon (funcall (intern (format "%s-family" (car icon)))) nil)))
    947 
    948 (defun all-the-icons-icon-family (icon)
    949   "Get a propertized ICON family programmatically."
    950   (plist-get (get-text-property 0 'face icon) :family))
    951 
    952 (all-the-icons-cache #'all-the-icons-icon-family-for-file)
    953 (all-the-icons-cache #'all-the-icons-icon-family-for-mode)
    954 (all-the-icons-cache #'all-the-icons-icon-family)
    955 
    956 (defun all-the-icons--icon-info-for-buffer (&optional f)
    957   "Get icon info for the current buffer.
    958 
    959 When F is provided, the info function is calculated with the format
    960 `all-the-icons-icon-%s-for-file' or `all-the-icons-icon-%s-for-mode'."
    961   (let* ((base-f (concat "all-the-icons-icon" (when f (format "-%s" f))))
    962          (file-f (intern (concat base-f "-for-file")))
    963          (mode-f (intern (concat base-f "-for-mode"))))
    964     (if (and (buffer-file-name)
    965              (all-the-icons-auto-mode-match?))
    966         (funcall file-f (file-name-nondirectory (buffer-file-name)))
    967       (funcall mode-f major-mode))))
    968 
    969 ;; Weather icons
    970 (defun all-the-icons-icon-for-weather (weather)
    971   "Get an icon for a WEATHER status."
    972   (let ((icon (all-the-icons-match-to-alist weather all-the-icons-weather-icon-alist)))
    973     (if icon (apply (car icon) (cdr icon)) weather)))
    974 
    975 ;; Definitions
    976 
    977 (eval-and-compile
    978   (defun all-the-icons--function-name (name)
    979     "Get the symbol for an icon function name for icon set NAME."
    980     (intern (concat "all-the-icons-" (downcase (symbol-name name)))))
    981 
    982   (defun all-the-icons--family-name (name)
    983     "Get the symbol for an icon family function for icon set NAME."
    984     (intern (concat "all-the-icons-" (downcase (symbol-name name)) "-family")))
    985 
    986   (defun all-the-icons--data-name (name)
    987     "Get the symbol for an icon family function for icon set NAME."
    988     (intern (concat "all-the-icons-" (downcase (symbol-name name)) "-data")))
    989 
    990   (defun all-the-icons--insert-function-name (name)
    991     "Get the symbol for an icon insert function for icon set NAME."
    992     (intern (concat "all-the-icons-insert-" (downcase (symbol-name name)))))
    993 
    994   (defun all-the-icons--family-scale-factor (family)
    995     (intern (concat "all-the-icons-" (symbol-name family) "-scale-factor")))
    996 
    997   (defun all-the-icons--family-adjust (family)
    998     (intern (concat "all-the-icons-default-" (symbol-name family) "-adjust"))))
    999 
   1000 ;; Icon insertion functions
   1001 
   1002 (defun all-the-icons--read-candidates ()
   1003   "Helper to build a list of candidates for all families."
   1004   (cl-reduce 'append (mapcar (lambda (it) (all-the-icons--read-candidates-for-family it t)) all-the-icons-font-families)))
   1005 
   1006 (defun all-the-icons--read-candidates-for-family (family &optional show-family)
   1007   "Helper to build read candidates for FAMILY.
   1008 If SHOW-FAMILY is non-nil, displays the icons family in the candidate string."
   1009   (let ((data   (funcall (all-the-icons--data-name family)))
   1010         (icon-f (all-the-icons--function-name family)))
   1011     (mapcar
   1012      (lambda (it)
   1013        (let* ((icon-name (car it))
   1014               (icon-name-head (substring icon-name 0 1))
   1015               (icon-name-tail (substring icon-name 1))
   1016 
   1017               (icon-display (propertize icon-name-head 'display (format "%s\t%s" (funcall icon-f icon-name) icon-name-head)))
   1018               (icon-family (if show-family (format "\t[%s]" family) ""))
   1019 
   1020               (candidate-name (format "%s%s%s" icon-display icon-name-tail icon-family))
   1021               (candidate-icon (funcall (all-the-icons--function-name family) icon-name)))
   1022 
   1023          (cons candidate-name candidate-icon)))
   1024      data)))
   1025 
   1026 ;;;###autoload
   1027 (defun all-the-icons-install-fonts (&optional pfx)
   1028   "Helper function to download and install the latests fonts based on OS.
   1029 When PFX is non-nil, ignore the prompt and just install"
   1030   (interactive "P")
   1031   (when (or pfx (yes-or-no-p "This will download and install fonts, are you sure you want to do this?"))
   1032     (let* ((url-format "https://raw.githubusercontent.com/domtronn/all-the-icons.el/master/fonts/%s")
   1033            (font-dest (cond
   1034                        ;; Default Linux install directories
   1035                        ((member system-type '(gnu gnu/linux gnu/kfreebsd))
   1036                         (concat (or (getenv "XDG_DATA_HOME")
   1037                                     (concat (getenv "HOME") "/.local/share"))
   1038                                 "/fonts/"))
   1039                        ;; Default MacOS install directory
   1040                        ((eq system-type 'darwin)
   1041                         (concat (getenv "HOME") "/Library/Fonts/"))))
   1042            (known-dest? (stringp font-dest))
   1043            (font-dest (or font-dest (read-directory-name "Font installation directory: " "~/"))))
   1044 
   1045       (unless (file-directory-p font-dest) (mkdir font-dest t))
   1046 
   1047       (mapc (lambda (font)
   1048               (url-copy-file (format url-format font) (expand-file-name font font-dest) t))
   1049             all-the-icons-font-names)
   1050       (when known-dest?
   1051         (message "Fonts downloaded, updating font cache... <fc-cache -f -v> ")
   1052         (shell-command-to-string (format "fc-cache -f -v")))
   1053       (message "%s Successfully %s `all-the-icons' fonts to `%s'!"
   1054                (all-the-icons-wicon "stars" :v-adjust 0.0)
   1055                (if known-dest? "installed" "downloaded")
   1056                font-dest))))
   1057 
   1058 ;;;###autoload
   1059 (defun all-the-icons-insert (&optional arg family)
   1060   "Interactive icon insertion function.
   1061 When Prefix ARG is non-nil, insert the propertized icon.
   1062 When FAMILY is non-nil, limit the candidates to the icon set matching it."
   1063   (interactive "P")
   1064   (let* ((standard-output (current-buffer))
   1065          (candidates (if family
   1066                          (all-the-icons--read-candidates-for-family family)
   1067                        (all-the-icons--read-candidates)))
   1068          (prompt     (if family
   1069                          (format "%s Icon: " (funcall (all-the-icons--family-name family)))
   1070                        "Icon : "))
   1071 
   1072          (selection (completing-read prompt candidates nil t))
   1073          (result    (cdr (assoc selection candidates))))
   1074 
   1075     (if arg (prin1 result) (insert result))))
   1076 
   1077 ;; Debug Helpers
   1078 
   1079 (defun all-the-icons-insert-icons-for (family &optional height duration)
   1080   "Insert all of the available icons associated with FAMILY.
   1081 If a HEIGHT is provided it will render the icons at this height.
   1082 This is useful both to see the icons more clearly and to test
   1083 different height rendering.  If DURATION is provided, it will
   1084 pause for DURATION seconds between printing each character."
   1085   (let* ((data-f    (all-the-icons--data-name family))
   1086          (insert-f  (all-the-icons--function-name family))
   1087 
   1088          (height (or height 2.0))
   1089          (data (funcall data-f)))
   1090     (mapc
   1091      (lambda (it)
   1092        (insert (format "%s - %s\n" (funcall insert-f (car it) :height height) (car it)))
   1093        (when duration (sit-for duration 0)))
   1094      data)))
   1095 
   1096 (defmacro all-the-icons-define-icon (name alist family &optional font-name)
   1097   "Macro to generate functions for inserting icons for icon set NAME.
   1098 
   1099 NAME defines is the name of the iconset and will produce a
   1100 function of the for `all-the-icons-NAME'.
   1101 
   1102 ALIST is the alist containing maps between icon names and the
   1103 UniCode for the character.  All of these can be found in the data
   1104 directory of this package.
   1105 
   1106 FAMILY is the font family to use for the icons.
   1107 FONT-NAME is the name of the .ttf file providing the font, defaults to FAMILY."
   1108   `(progn
   1109      (add-to-list 'all-the-icons-font-families (quote ,name))
   1110      (add-to-list 'all-the-icons-font-names (quote ,(downcase (format "%s.ttf" (or font-name family)))))
   1111      (defcustom ,(all-the-icons--family-scale-factor name) 1.0
   1112        ,(format "The additional `height' face property Scale Factor for %s icons."
   1113                 (symbol-name name))
   1114        :group 'all-the-icons
   1115        :type 'number)
   1116      (defcustom ,(all-the-icons--family-adjust name) 0.0
   1117        ,(format "The additional `raise' display property adjustment for %s icons."
   1118                 (symbol-name name))
   1119        :group 'all-the-icons
   1120        :type 'number)
   1121      (defun ,(all-the-icons--family-name name) () ,family)
   1122      (defun ,(all-the-icons--data-name name) () ,alist)
   1123      (defun ,(all-the-icons--function-name name) (icon-name &rest args)
   1124        (let ((icon (cdr (assoc icon-name ,alist)))
   1125              (other-face (when all-the-icons-color-icons (plist-get args :face)))
   1126              (height   (* all-the-icons-scale-factor
   1127                           ,(all-the-icons--family-scale-factor name)
   1128                           (or (plist-get args :height) 1.0)))
   1129              (v-adjust (* all-the-icons-scale-factor ,(all-the-icons--family-scale-factor name)
   1130                           (+ (or (plist-get args :v-adjust) all-the-icons-default-adjust)
   1131                              ,(all-the-icons--family-adjust name))))
   1132              (family ,family))
   1133          (unless icon
   1134            (error (format "Unable to find icon with name `%s' in icon set `%s'" icon-name (quote ,name))))
   1135          (let ((face (if other-face
   1136                          `(:family ,family :height ,height :inherit ,other-face)
   1137                        `(:family ,family :height ,height))))
   1138            (propertize icon
   1139                        'face face           ;so that this works without `font-lock-mode' enabled
   1140                        'font-lock-face face ;so that `font-lock-mode' leaves this alone
   1141                        'display `(raise ,v-adjust)
   1142                        'rear-nonsticky t))))
   1143      (defun ,(all-the-icons--insert-function-name name) (&optional arg)
   1144        ,(format "Insert a %s icon at point." family)
   1145        (interactive "P")
   1146        (all-the-icons-insert arg (quote ,name)))))
   1147 
   1148 (define-obsolete-function-alias 'define-icon 'all-the-icons-define-icon "4.0.0")
   1149 
   1150 (all-the-icons-define-icon alltheicon all-the-icons-data/alltheicons-alist    "all-the-icons")
   1151 (all-the-icons-define-icon fileicon   all-the-icons-data/file-icon-alist      "file-icons")
   1152 (all-the-icons-define-icon faicon     all-the-icons-data/fa-icon-alist        "FontAwesome")
   1153 (all-the-icons-define-icon octicon    all-the-icons-data/octicons-alist       "github-octicons" "octicons")
   1154 (all-the-icons-define-icon wicon      all-the-icons-data/weather-icons-alist  "Weather Icons"   "weathericons")
   1155 (all-the-icons-define-icon material   all-the-icons-data/material-icons-alist "Material Icons"  "material-design-icons")
   1156 
   1157 (provide 'all-the-icons)
   1158 
   1159 ;;; all-the-icons.el ends here