Giter Club home page Giter Club logo

all-the-icons.el's Introduction

logo.png

Installation

You should be able to install this package in the standard way, add it to the load path and then calling

(require 'all-the-icons)
;; or
(use-package all-the-icons)

However, in order for the icons to work you will need to install the Resource Fonts included in this package, they are available in the fonts directory.

Usage

The simplest usage for this package is to use the following functions;

  • all-the-icons-icon-for-buffer
  • all-the-icons-icon-for-file
  • all-the-icons-icon-for-mode

Which can be used to get a formatted icon which you can insert into buffers, e.g.

(insert (all-the-icons-icon-for-file "foo.js"))
;; Inserts a javascript icon
;; #("" 0 1 (display (raise -0.24) face (:family "dev-icons" :height 1.08 :foreground "#FFD446")))

Inserting Icons Directly

The above is fine if you want this package to automatically decide on the icon you want for files and things, however, to insert the icons directly you will want to use these icons functions;

  • all-the-icons-alltheicon
  • all-the-icons-devicon
  • all-the-icons-faicon
  • all-the-icons-fileicon
  • all-the-icons-oction
  • all-the-icons-wicon

You can then call these functions with the icon you want to insert, e.g.

(all-the-icons-octicon "file-binary")  ;; GitHub Octicon for Binary File
(all-the-icons-faicon  "cogs")         ;; FontAwesome icon for cogs
(all-the-icons-wicon   "tornado")      ;; Weather Icon for tornado

A list of all the icon names for a font family can be found in the data directory, or by inspecting the alist variables.

The alist variables are all prefixed with

  • all-the-icons-data/

For example C-h v all-the-icons-data/ <TAB> will give a list of all the data alist you can describe (and the icon fonts they’re associated with)

Inserting icons with properties

Each of the above icon functions can also be given different properties to slightly adjust the way they’re formatted, these are

  • :height - The height of the icon
  • :v-adjust - Vertical adjust (positive is up, negative is down)
  • :face - The face to apply to the icon, defaults to \'default

So you would call, for example

(all-the-icons-wicon "tornado" :face 'all-the-icons-blue)

Propertizing icons yourself

However, sometimes when propertizing these icons (for example if you were customising your mode line) you may sometimes have to know the font family to add in to override the current font family being used, e.g.

(propertize (all-the-icons-octicon "package")
            'face `(:family ,(all-the-icons-octicon-family) :height 1.2)
            'display '(raise -0.1))

Resource Fonts

All of the fonts provided in this packages as resources come with either the SIL Open Font License (OFL) or an MIT License, below I will link to each of the fonts Sources and their Licenses.

Font NameFontLicense
file-icons.ttfAtom File Icons PluginMIT LICENSE
iconmoon-devicons.ttfDevIconsMIT LICENSE
fontawesome.ttfFontAwesome IconsSIL OFL LICENSE
ocitcons.ttfGitHub OctIconsSIL OFL LICENSE
weathericons.ttfWeather IconsSIL OFL LICENSE
all-the-icons.ttfCustom Made Font

The fonts provided with this packages are locked down to a version for unicode character mapping values. In the future, these may be automatically generated.

I would like to thank all the authors for the creation and use of these fantastic fonts.

Wiki

Lastly, there is a Wiki Page which should give you some ideas of ways to use this library to spruce up other Emacs packages.

▲ back to top

all-the-icons.el's People

Contributors

domtronn avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.