Giter Site home page Giter Site logo

domtronn / all-the-icons.el Goto Github PK

View Code? Open in Web Editor NEW
1.4K 30.0 173.0 27.61 MB

A utility package to collect various Icon Fonts and propertize them within Emacs.

License: MIT License

Emacs Lisp 99.97% Clojure 0.01% CoffeeScript 0.01% CSS 0.01% JavaScript 0.01% HTML 0.01% Python 0.01% Shell 0.01% Elixir 0.01% Erlang 0.01% OCaml 0.01% TypeScript 0.01% Hack 0.01% Haml 0.01% Slim 0.01% SCSS 0.01% Euphoria 0.01%
emacs font-icons

all-the-icons.el's Introduction

img

Installation | Usage | Fonts | Wiki

Installation

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

(when (display-graphic-p)
  (require 'all-the-icons))
;; or
(use-package all-the-icons
  :if (display-graphic-p))

Installing Fonts

In order for the icons to work it is very important that you install the Resource Fonts included in this package, they are available in the fonts directory. You can also install the latest fonts for this package in the (guessed?) based on the OS by calling the following function;

M-x all-the-icons-install-fonts

Bear in mind, this will also run fc-cache -f -v on MacOS and Linux which can take some time to complete. For Windows, this function will prompt for a download directory for you to install them manually.

Usage

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

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

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
    ;; #("js-icon" 0 1 (display (raise -0.24) face (:family "alltheicon" :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-faicon
  • all-the-icons-fileicon
  • all-the-icons-octicon
  • 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)

These properties can also be used on the all-the-icons-icon-for-file and all-the-icons-icon-for-mode functions as well, i.e.

(insert (all-the-icons-icon-for-file "foo.js" :height 2 :face 'all-the-icons-lred))
    ;; Inserts a RED Javascript icon with height 2
    ;; #("js-icon" 0 1 (display (raise -0.24) face (:family "alltheicon" :height 2.0 :foreground "red")))

The default icon :height and :v-adjust properties can be set with the all-the-icons-scale-factor and all-the-icons-default-adjust variables. Additional adjustments can be made per font family via the all-the-icons-{familyname}-scale-factor and all-the-icons-default-{familyname}-adjust variables, where {familyname} is any member of all-the-icons-font-families.

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))

Troubleshooting

If you see placeholders (AKA tofus) being rendered, or the wrong icons being displayed, the underlying cause generally falls into one of three categories:

  1. Font installation failed due to networking issues. Check your OS' and Emacs' networking (M-x customize-group RET gnutls/nsm/url/network RET) and security settings (i.e. proxy, firewall, antivirus software...)
  2. On *nix systems, make sure the font cache has been updated. all-the-icons-install-fonts should do this for you automatically, but sometimes it may fail due to misconfiguration.
  3. You've misconfigured your font settings in Emacs.

To check if you've misconfigured your Emacs font settings, you can try the following steps:

  1. Print out all of the icons in an icon set and their corresponding id/name.
;; Valid font families are 'material 'wicon 'octicon 'faicon 'fileicon and 'alltheicon

(all-the-icons-insert-icons-for 'alltheicon)   ;; Prints all the icons for `alltheicon' font set

(all-the-icons-insert-icons-for 'octicon 10)   ;; Prints all the icons for the `octicon' family
                                               ;; and makes the icons height 10

(all-the-icons-insert-icons-for 'faicon 1 0.5) ;; Prints all the icons for the `faicon' family
                                               ;; and also waits 0.5s between printing each one
  1. Now that you are certain which icon set is not displaying properly, check the fontset currently in effect.
  • Look up the hex code of the icon from the data/data-[font-family].el file. Write it down.
  • M-x describe-fontset RET RET
  • Now you are looking at the fontset for the current frame, search for the hex range for that icon. Usually it's #xE000, or #xF0 #xF2, but there are a few outside of these offsets.
  • If you don't see the font family in question in the list of fontspecs (i.e. [-*-file-icons-...]) below the range, or some other fontspecs in front of the one in question, you will have to add the families back to the fontset (scroll to the top to see which one is in effect), or arrange the fontspec order. For example:
;; Use 'prepend for the NS and Mac ports or Emacs will crash.
(set-fontset-font t 'unicode (font-spec :family "all-the-icons") nil 'append)
(set-fontset-font t 'unicode (font-spec :family "file-icons") nil 'append)
(set-fontset-font t 'unicode (font-spec :family "Material Icons") nil 'append)
(set-fontset-font t 'unicode (font-spec :family "github-octicons") nil 'append)
(set-fontset-font t 'unicode (font-spec :family "FontAwesome") nil 'append)
(set-fontset-font t 'unicode (font-spec :family "Weather Icons") nil 'append)

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 Name Font License
file-icons.ttf Atom File Icons Plugin MIT LICENSE
fontawesome.ttf FontAwesome Icons SIL OFL LICENSE
ocitcons.ttf GitHub OctIcons SIL OFL LICENSE
weathericons.ttf Weather Icons SIL OFL LICENSE
material-design-icons.ttf Material Icons APACHE LICENSE v2.0
all-the-icons.ttf Custom Made Font MIT LICENSE

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.

Slow Rendering

If you experience a slow down in performance when rendering multiple icons simultaneously, you can try setting the following variable

(setq inhibit-compacting-font-caches t)

Some people have found that this fixes the problem

▲ back to top

all-the-icons.el's People

Contributors

aborn avatar autrimpo avatar balakhorvathnorbert avatar bricka avatar cmarqu avatar conao3 avatar derinsh avatar domtronn avatar ebpa avatar egregius313 avatar ema2159 avatar ivantomica avatar iyefrat avatar jacobilsoe avatar jwintz avatar kwrooijen avatar mohkale avatar nbarrientos avatar nequissimus avatar nlamirault avatar poisonedpigeons avatar progfolio avatar rememberyou avatar seagle0128 avatar sebastiaanspeck avatar smona avatar ss141309 avatar thaodan avatar wyuenho avatar ymarco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

all-the-icons.el's Issues

Can't change go icon size

Hi,
i try to insert the golang icon .
In go-mode, i can't use the function all-the-icons-data/devicons-alist , but it works with "go" :

ELISP> (assoc "go-mode" all-the-icons-data/devicons-alist)
nil
ELISP> (assoc "go" all-the-icons-data/devicons-alist)
 (assoc "go" all-the-icons-data/devicons-alist)
("go" . "")
ELISP> (all-the-icons-devicon "go")
#("" 0 1
  (display
   (raise -0.24)
   face
   (:family "icomoon" :height 1.2 :inherit nil)))
ELISP> (propertize (all-the-icons-devicon "go")
            'face `(:family ,(all-the-icons-devicon-family) :height 0.1)
            'display '(raise -0.1))
#("" 0 1
  (face
   (:family "icomoon" :height 0.1)
   display
   (raise -0.1)))

But in the buffer, the icon is the same size for (all-the-icons-devicon "go") and (propertize ...)

any idead how to fix that ?
Thanks

Icon unicode conflict?

Using neotree icons theme, some icons are wrong.
Take a look at the screenshot:
selection_419
I don't know why weather icons messed in.

             position: 1137 of 7154 (16%), column: 5
            character:  (displayed as ) (codepoint 61487, #o170057, #xf02f)
    preferred charset: unicode (Unicode (ISO10646))
code point in charset: 0xF02F
               syntax: w 	which means: word
             category: L:Left-to-right (strong)
             to input: type "C-x 8 RET f02f"
          buffer code: #xEF #x80 #xAF
            file code: #xEF #x80 #xAF (encoded by coding system utf-8)
              display: by this font (glyph code)
    xft:-UKWN-Weather Icons-normal-normal-normal-*-19-*-*-*-*-0-iso10646-1 (#x3F)

How to use this package with speedbar?

Thanks for this great package! It looks awesome with neotree and dired. I also use speedbar a lot so I'm curious if there is any way to make the two work together? I googled but there is barely any relevant information.

Certain icons are too large

Some of the file icons being displayed are too big, here are some screenshots:
https://s17.postimg.io/7yquh6767/Screenshot_from_2016_09_15_14_24_10.png
https://s9.postimg.io/jzuzm0dbz/Screenshot_from_2016_09_15_15_03_15.png

This issue was discussed here as well: doomemacs/themes#8

I'm running Linux (Fedora 25) and Emacs 25.1.1 (but Emacs 24 has the same issue)

I installed the fonts by dropping the ttf files in /usr/share/fonts/all-the-icons and running fc-cache -f -v.

The icons that I'm aware of that are having this issue are:

  • terminal (for example .sh)
  • python (.py)
  • html (.html .erb)

I believe I installed the fonts correctly as other icons are being displayed properly, other people (but not all) are also having this issue (see emacs-doom-theme link).

If there's any other info I can give you let me know.

PS: as for Emacs configuration, I tested it (as well) with a completely raw emacs config and only install all-the-icons through melpa. image

Git Gutter support

Does somebody tried overwrite default git gutter symbols?
Currently I'm using that plus symbol, but it looks ugly in my opinion

  (fringe-helper-define 'git-gutter-fr+-added nil
    "...XX..."
    "...XX..."
    "...XX..."
    "XXXXXXXX"
    "XXXXXXXX"
    "...XX..."
    "...XX..."
    "...XX...")

segment fault

I execute code:

(all-the-icons-oction "git-branch")

This caused Emacs segment fault.

golang icon

I can't retrieve the golang icon :

ELISP> (all-the-icons-match-to-alist "/tmp/foo.java" all-the-icons-icon-alist)
(all-the-icons-devicon "java" :height 1.0 :face all-the-icons-purple)
ELISP> (all-the-icons-match-to-alist "/tmp/nyx.go" all-the-icons-icon-alist)
(all-the-icons-faicon "file-o" :height 0.8 :v-adjust 0.0 :face all-the-icons-dsilver)
ELISP> (all-the-icons-match-to-alist "/tmp/nyx.py" all-the-icons-icon-alist)
(all-the-icons-devicon "python" :height 1.0 :face all-the-icons-dblue)

Strange separator rendering

First thank you for your great work. You spaceline config looks great and I would love to have the same, but I get some strange rendering issues.
screen shot 2016-12-20 at 21 55 36
I tried to play around using different fonts, sizes and tweaking numbers in your theme, but could not figure out, why this happens. Any ideas?

My config can be found here

Flycheck status: Add info messages to spaceline

it looks like all-the-icons-spaceline.el completely ignores any info messages by flycheck. It would make sense to add them to the list of issues or add a separate segment for info messages for flycheck.

Not working on neotree

I can't get this to work with neotree. I've followed the instructions in this video, but all I get are squares with hex numbers in them. I use Spacemacs.

Feature request: all-the-icons-icon-for-url

It would be nice to have a function all-the-icons-icon-for-url which chooses an icon based on a URL. Ofcourse it would be hard to cover all possibilities, but as a starter the function and the alist could be added, and then people could send in pull requests with new link types.

For instance if the URL matches wikipedia.org, the Wikipedia icon could be used.

Added dired support

Thank you for your really cool emacs mode.

I just wanted to let you know that I added dired support here.

Include icon aliases

I haven't checked the other font families, but FontAwesome includes icon aliases. This can help with icon discoverability / semantic use of the icons. It would be helpful for users of all-the-icons to have access to these aliases.

For example: "gears" is an alias (an alternate name) for "cogs" in FontAwesome. Users searching for "gears" find the icon they are looking for and don't need to divine the true library name "cogs" (which may be less intuitive).

Here is one definition in the FA project: https://github.com/FortAwesome/Font-Awesome/blob/fc064e9d5c938c3d8ebc29862be1e3a0ff43fb44/src/icons.yml#L171-L173

Icons not aligned

image
image

I read #33 and related commit. Tab symbol aligns but for a whole symbol 😂. Not sure if fixable. Thought that should raise an issue in case you didn't know. Btw, I'm using Fira Code fonts

spaceline-ml-ati not work with dashboard mode

When combine this with dashboard,
Following error was raised,

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p #<buffer *dashboard*>)
  spaceline-ml-ati()
  eval((spaceline-ml-ati) nil)
  eval-expression((spaceline-ml-ati) nil)
  funcall-interactively(eval-expression (spaceline-ml-ati) nil)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

When I resize the emacs window, everything is fine.

Use `rear-nonsticky` text property.

Currently, when typing e.g.,

(insert (all-the-icons-faicon "dropbox"))

and then hitting C-x c-e, the Dropbox icon is inserted in the buffer, but in such a way that subsequent characters inherit the icon's text properties. Since these include a face property, characters inserted immediately after the Dropbox icon are displayed in the same FontAwesome font, which is usually not what you'd want. Adding the text property rear-nonsticky to the icon with the value t solves this issue.

Would it be a good idea to add this text property to the string returned by all-the-icons-faicon and similar functions?

Adding compilation mode

Hello,

First of all, thanks for this awesome package.

I wanted to add an icon for compilation-mode that I use a lot, so I went into all-the-icons.el and added the following to the list all-the-icons-mode-icon-alist.

        (compilation-mode all-the-icons-faicon "cogs" :height 1.0 :v-adjust 0.0)

However, I'm using all-the-icons in many places but I'm particularly interested in my modeline segment (using spaceline) which is defined as follows

    (spaceline-define-segment prolusion-mode-icon
      (let ((icon (all-the-icons-icon-for-buffer)))
        (unless (symbolp icon)
          (propertize icon
                    'help-echo (format "Major-mode: `%s`" major-mode)
                    'display '(raise 0.0)
                    'face `(:height 0.9 :family ,(all-the-icons-icon-family-for-buffer) :inherit)))))

all-the-icons-icon-for-buffer doesn't provides me with compilation-mode. I guess it comes from ...

        (if (and (buffer-file-name)
             (all-the-icons-auto-mode-match?))

... which is ...

    (defun all-the-icons-auto-mode-match? (&optional file)
      "Whether or not FILE's `major-mode' match against its `auto-mode-alist'."
      (let* ((file (or file (buffer-file-name) (buffer-name)))
             (auto-mode (all-the-icons-match-to-alist file auto-mode-alist)))
        (eq major-mode auto-mode)))

... which is ...

    (defun all-the-icons-match-to-alist (file alist)
      "Match FILE against an entry in ALIST using `string-match'."
      (cdr (--first (string-match (car it) file) alist)))

The point is, I do not see any fallback for the mode involving all-the-icons-mode-icon-alist.

Could you please point me to what I'm missing ?

all-the-icons-install-fonts doesn't work behind a proxy

M-x all-the-icons-install-fonts

doesn't work behind a proxy, while at least the Emacs package manager honors the proxy settings.

The specific error is:
open-network-stream: make client process failed: connection refused, :name, github.com, :buffer,#<killed buffer>, :host, github.com, :service, 443, :nowait, nil

Installation issue

When I install all-the-icons through emacs package manager, I got the following error:
package 'font-lock+-0' is unavailable.

What does this mean?

Question regarding usage of icons for other places in Emacs

Hi,
I love your package.

Have you ever thought about adding the icons to the buffer switcher or find file? At least for the buffer switching having the same icon for the buffers having the same major-mode would be a huge visual hint. I mean something like what you do with displaying the icon next to the icon name in all-the-icons-insert.

Do you think it's doable? Do you think that it would add a lot of overhead?

Some icons not correctly display

When I use code:

(all-the-icons-icon-for-file (buffer-file-name) :v-adjust -0.05)

in my custom mode-line.

The icon is wrong, not the correct icon. For example, the elisp buffer should show the emacs icon, but it is not. Not just elisp icon, also including Org-mode icon, and clojure-mode icon etc.

Check out the screenshot.

all-the-icons wrong icons

BTW, seems I can't change the icon size. How to adjust the icon size by override args?

Show icons in Org-Agenda buffer

Org-Agenda can display icon in buffer with the following settings:

(setq org-agenda-category-icon-alist
      '(("Diary" "~/.emacs.d/resources/icon/diary.xpm" nil nil :ascent center)
        ("Todo" "~/.emacs.d/resources/icon/todo.xpm" nil nil :ascent center)
        ("Star" "~/.emacs.d/resources/icon/star.xpm" nil nil :ascent center)
        ;; ("Org" "~/.emacs.d/resources/icon/Org-mode.xpm" nil nil :ascent center)
        ("Org" '(all-the-icons-faicon "cogs") nil nil :ascent center)
...

I tried the upper method, but it does not work. Hope to find a way to show all-the-icons in org-agenda buffer. Thanks.

XML

Currently XML files are not recognized. Is there an existing icon we could use to present XML files?

mm-write-region: Opening output file: No such file or directory, ~/.local/share/fonts/material-design-icons.ttf

Hi, today I was installing your package and I ran into issue very similar to #60.
mm-write-region: Opening output file: No such file or directory, /home/tlegutko/.local/share/fonts/material-design-icons.ttf
But the problem was not the XDG_DATA_HOME (I didn't have it set, but when I set it I still had the same error - so auto-resolution was correct), but it still assumed that I should have material-design-icons.ttf prior to installation - when I downloaded the file manually, the installation went smoothly. So I think one of the following should ease the installation process:

  1. Either this file is somehow required and please mention it in README installation step.
  2. Check for this file shouldn't fail and it should just download it during installation process.
    I'm leaning onto the second, because during installation it downloaded several other fonts, including material design icons..

My setup: Arch Linux, GNU Emacs 25.2.1, all-the-icons 2.5.2.

Functions to insert icon keywords / classnames

Most uses of icons in web development rely on the keywords or classnames of icons. Interactive / visual lookup is very helpful and the ultimate goal in this context is to insert the keyword or classname(s) corresponding to that icon.

Expressing an icon in HTML for example:

<i class="fa fa-area-chart" aria-hidden="true"></i>

A generally useful function that would be useful to include in this library (maybe all-the-icons-insert-faicon-classname?) would insert/return "fa-area-chart". More specific behavior like insertion of html or additional classes (like "fa") could be left to the user to accomplish with user functions / snippets.

Getting different (incorrect) icons when using eval-expression

I was playing around with this package a bit and spent some time with this oddity.

If I run (all-the-icons-icon-for-file "foo.rb") using eval-expression, then I often get back the incorrect icon. What I get back varies depending on what font family is installed, I'm currently getting back a weather icon, but have also seen a four arrows and what looks like a wizard a staff. However, when I run (insert (all-the-icons-icon-for-file "foo.rb")), the expected ruby icon is inserted in the buffer.

Invalid character

Hi,
I'm getting this error:
Debugger entered--Lisp error: (error "Invalid character: 59657, #o164411, #xe909")
eval-buffer(#<buffer load<3>> nil "~/.emacs.d/modules/all-the-icons/data/data-alltheicons.el" nil t) ; Reading at buffer position 88

Not sure if this is related, but the only commands I have available are:
Possible completions are:
all-the-icons-insert all-the-icons-insert-alltheicon
all-the-icons-insert-faicon all-the-icons-insert-fileicon
all-the-icons-insert-material all-the-icons-insert-octicon
all-the-icons-insert-wicon all-the-icons-install-fonts

Any idea?

Problem with the face

peek 27-04-2017 18-01

If I set the face once for an icon, I cannot get the orignal face with a second call.
Is it an expected behavior ?
I also tried with :face 'default but it returns a different icon.

How do you work around variable-width glyphs in the mode-line?

I have wrote my own minimal package for insert icons as an exercise. I used it with spaceline.

With icons wider than a regular character in the mode-line, the content is shifted to the right because spaceline relies on the string length to pad things. As a result, when I use my icons in right-aligned segments, part of the mode-line is truncated.

From the screenshots, it seems you don't have this issue yourself with all-the-icons. But I can't find the relevant part of the code I should focus on.

Edit: I added 2 extra icons to better show the shift.

image

Spaceline code from wiki doesn't work

Tried using the code from wiki but it looks like there are some missing dependencies.
I added yahoo-weather which was missing but still getting spaceline-ml-ati doesn't evaluate.
If I try executing it in ielm I get following error.

*** Eval error ***  Wrong type argument: stringp, nil

I'm trying this with Spacemacs which includes spaceline.

Bug: `all-the-icons--icon-info-for-buffer` does not return an icon if the buffer has no associated file.

First of, great package dood. I was finally able to make my own mode line configuration inspired by this package. One of the things I always wanted to customize for a long time. Really thanks.

Anyway, let's say I have a buffer meow.org; the function all-the-icons--icon-info-for-buffer (which is called by all-the-icons-icon-for-buffer) returns org-mode. When I save the buffer as ~/meow.org, it now returns the icon of org-mode which is what I wanted in the first place. Is this an intended behavior or a bug? If it is a bug, I can make a PR if I can help.

Can't download fonts

When I try to install fonts with all-the-icons-install-fonts I see this error on emacs 25.2 on linux:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  file-directory-p(nil)
  (if (file-directory-p font-dest) nil (mkdir font-dest t))
  (let* ((url-format "https://github.com/domtronn/all-the-icons.el/blob/master/fonts/%s?raw=true") (font-dest (cond ((eql window-system (quote x)) (concat (or (getenv "XDG_DATA_HOME") (concat ... "/.local/share")) "/fonts/")) ((eql window-system (quote mac)) (concat (getenv "HOME") "/Library/Fonts/")) ((eql window-system (quote ns)) (concat (getenv "HOME") "/Library/Fonts/")))) (known-dest\? (stringp font-dest)) (font-dest (if font-dest nil (read-directory-name "Font installation directory: " "~/")))) (if (file-directory-p font-dest) nil (mkdir font-dest t)) (mapc (function (lambda (font) (url-copy-file (format url-format font) (expand-file-name font font-dest) t))) all-the-icons-font-names) (if known-dest\? (progn (message "Fonts downloaded, updating font cache... <fc-cache -f -v> ") (shell-command-to-string (format "fc-cache -f -v")))) (message "%s Successfully %s `all-the-icons' fonts to `%s'!" (all-the-icons-wicon "stars" :v-adjust 0.0) (if known-dest\? "installed" "downloaded") font-dest))
  (progn (let* ((url-format "https://github.com/domtronn/all-the-icons.el/blob/master/fonts/%s?raw=true") (font-dest (cond ((eql window-system (quote x)) (concat (or ... ...) "/fonts/")) ((eql window-system (quote mac)) (concat (getenv "HOME") "/Library/Fonts/")) ((eql window-system (quote ns)) (concat (getenv "HOME") "/Library/Fonts/")))) (known-dest\? (stringp font-dest)) (font-dest (if font-dest nil (read-directory-name "Font installation directory: " "~/")))) (if (file-directory-p font-dest) nil (mkdir font-dest t)) (mapc (function (lambda (font) (url-copy-file (format url-format font) (expand-file-name font font-dest) t))) all-the-icons-font-names) (if known-dest\? (progn (message "Fonts downloaded, updating font cache... <fc-cache -f -v> ") (shell-command-to-string (format "fc-cache -f -v")))) (message "%s Successfully %s `all-the-icons' fonts to `%s'!" (all-the-icons-wicon "stars" :v-adjust 0.0) (if known-dest\? "installed" "downloaded") font-dest)))
  (if (or pfx (yes-or-no-p "This will download and install fonts, are you sure you want to do this?")) (progn (let* ((url-format "https://github.com/domtronn/all-the-icons.el/blob/master/fonts/%s?raw=true") (font-dest (cond ((eql window-system ...) (concat ... "/fonts/")) ((eql window-system ...) (concat ... "/Library/Fonts/")) ((eql window-system ...) (concat ... "/Library/Fonts/")))) (known-dest\? (stringp font-dest)) (font-dest (if font-dest nil (read-directory-name "Font installation directory: " "~/")))) (if (file-directory-p font-dest) nil (mkdir font-dest t)) (mapc (function (lambda (font) (url-copy-file (format url-format font) (expand-file-name font font-dest) t))) all-the-icons-font-names) (if known-dest\? (progn (message "Fonts downloaded, updating font cache... <fc-cache -f -v> ") (shell-command-to-string (format "fc-cache -f -v")))) (message "%s Successfully %s `all-the-icons' fonts to `%s'!" (all-the-icons-wicon "stars" :v-adjust 0.0) (if known-dest\? "installed" "downloaded") font-dest))))
  all-the-icons-install-fonts((4))
  funcall-interactively(all-the-icons-install-fonts (4))
  call-interactively(all-the-icons-install-fonts record nil)
  command-execute(all-the-icons-install-fonts record)
  #[257 "\304\305!\203\f

The example mode-line shown in this project partially "ported" for telephone-line

Hello!

I got part of your mode-line ported for using in telephone-line, here is the entire section of my telephone-line configuration:

(use-package telephone-line
  :preface (defun shackra/vc-state ()
             (vc-state (buffer-file-name (current-buffer))))
  :init
  (setf telephone-line-height 30)
  (custom-set-faces
   '(mode-line ((t (:box nil))))
   '(mode-line-inactive ((t (:box nil))))
   '(mode-line-highlight ((t (:box nil)))))
  :config
  (telephone-line-defsegment* shackra-buffer-vc-modified-segment
    (cond ((buffer-modified-p)
           (propertize (format " %s" (all-the-icons-faicon "pencil")) 'face `(:foreground "orange" :height 1.3 :family ,(all-the-icons-faicon-family))
                       'display '(raise -0.1) 'help-echo "Buffer modificado."))
          ((eq (shackra/vc-state) 'edited)
           (propertize (format " %s" (all-the-icons-faicon "pencil")) 'face `(:height 1.3 :family ,(all-the-icons-faicon-family))
                       'display '(raise -0.1) 'help-echo "Buffer modificado, cambios sin registrar."))
          ((eq (shackra/vc-state) 'unregistered)
           (propertize (format " %s" (all-the-icons-faicon "question")) 'face `(:height 1.3 :family ,(all-the-icons-faicon-family))
                       'display '(raise -0.1) 'help-echo "Archivo sin registrar al VCS."))
          ((eq (shackra/vc-state) 'missing)
           (propertize (format " %s" (all-the-icons-faicon "exclamation")) 'face `(:height 1.3 :family ,(all-the-icons-faicon-family))
                       'display '(raise -0.1) 'help-echo "Archivo sólo existe en VCS, no en el disco duro."))
          ((eq (shackra/vc-state) 'ignored)
           (propertize (format " %s" (all-the-icons-faicon "ban")) 'face `(:height 1.3 :family ,(all-the-icons-faicon-family))
                       'display '(raise -0.1) 'help-echo "Archivo ignorado"))
          ((eq (shackra/vc-state) 'added)
           (propertize (format " %s" (all-the-icons-faicon "plus")) 'face `(:height 1.3 :family ,(all-the-icons-faicon-family))
                       'display '(raise -0.1) 'help-echo "Archivo será registrado en VCS en el siguiente commit."))))

  (telephone-line-defsegment* shackra-line-buffer-segment
    `(""
      ,(telephone-line-raw mode-line-buffer-identification t)))

  (telephone-line-defsegment* shackra-vc-info
    (when vc-mode
      (cond ((string-match "Git[:-]" vc-mode)
             (let ((branch (mapconcat 'concat (cdr (split-string vc-mode "[:-]")) "-")))
               (concat
                (propertize (format " %s" (all-the-icons-alltheicon "git")) 'face `(:height 1.3) 'display '(raise -0.1))
                " · "
                (propertize (format "%s" (all-the-icons-octicon "git-branch"))
                            'face `(:height 1.3 :family ,(all-the-icons-octicon-family))
                            'display '(raise -0.1))
                (propertize (format " %s" branch) 'face `(:height 0.9)))))
            ((string-match "SVN-" vc-mode)
             (let ((revision (cadr (split-string vc-mode "-"))))
               (concat
                (propertize (format " %s" (all-the-icons-faicon "cloud")) 'face `(:height 1.3) 'display '(raise -0.1))
                (propertize (format " · %s" revision) 'face `(:height 0.9)))))
            (t (format "%s" vc-mode)))))
  (telephone-line-defsegment* shackra-flycheck-status
    (let* ((text (pcase flycheck-last-status-change
                   (`finished (if flycheck-current-errors
                                  (let ((count (let-alist (flycheck-count-errors flycheck-current-errors)
                                                 (+ (or .warning 0) (or .error 0)))))
                                    (format " ✖ %s problema%s" count (unless (eq 1 count) "s")))
                                " ✔ Sin problemas"))
                   (`running     " ⟲ En ejecución")
                   (`no-checker  " ⚠ No existe revisor")
                   (`not-checked " ✖ Deshabilitado")
                   (`errored     " ⚠ Error")
                   (`interrupted " ⛔ Interrumpido")
                   (`suspicious  ""))))
      (propertize text
                  'help-echo "Muestra errores detectados por Flycheck"
                  'mouse-face '(:box 1)
                  'local-map (make-mode-line-mouse-map
                              'mouse-1 (lambda () (interactive) (flycheck-list-errors))))))

  (setf telephone-line-lhs
        '((accent . (shackra-line-buffer-segment shackra-buffer-vc-modified-segment))
          (nil .  (shackra-vc-info shackra-flycheck-status))))

  (setf telephone-line-rhs '((nil . (telephone-line-misc-info-segment telephone-line-major-mode-segment))
                             (accent . (telephone-line-minor-mode-segment telephone-line-position-segment))))
  (telephone-line-mode 1))

This code assumes the user have (use-package all-the-icons) somewhere in his configuration.

Broken dependency?

For some reason i can't install package from MELPA. When i'm trying to install it i get
error: Package ‘font-lock+-0’ is unavailable
In fact that doesnt work with melpa-stable, with the regular melpa everything is ok so i think there is something wrong with package in melpa-stable

Icons not work correctly (linux)

I have strange symbols instead icons.
screenshot_20170221_190501

I use all-the-icons trough use-package:

(use-package all-the-icons
  :ensure t)

I have all files from this repo, including tff files. Thanks for any help!

Display the icons very slowly

I use Emacs25.1+windows10
When i use all-the-icons with neotree wo all-the-icons-dired ,while call neotree-toggle or dired(C-x d),the emacs become very slow.

the config is

(require 'all-the-icons)
(require 'all-the-icons-dired)
(add-hook 'dired-mode-hook 'all-the-icons-dired-mode)

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.