ibytao / spaceline-all-the-icons.el

A Spaceline Mode Line theme using All The Icons for Emacs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation | Usage | Customization | Debugging

Installation

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

(package-install 'spaceline-all-the-icons)

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

N.B. This package is highly dependent on all-the-icons.el, so make sure you have the fonts installed correctly

Usage

The simplest way to use this package is to set the mode-line-format to be the spaceline-all-the-icons theme or by calling spaceline-all-the-icons-theme

(use-package spaceline-all-the-icons 
  :after spaceline
  :config (spaceline-all-the-icons-theme))

Optional dependencies

There are a few segments that require optional packages and custom setup functions in order to run. Calling these two functions in your setup/config will enable the segments.

(spaceline-all-the-icons--setup-anzu)            ;; Enable anzu searching
(spaceline-all-the-icons--setup-package-updates) ;; Enable package update indicator
(spaceline-all-the-icons--setup-git-ahead)       ;; Enable # of commits ahead of upstream in git
(spaceline-all-the-icons--setup-paradox)         ;; Enable Paradox mode line
(spaceline-all-the-icons--setup-neotree)         ;; Enable Neotree mode line

Customization

The mode line is broken down into segments, where each segment can be toggled on or off independently.

Also, some of the segments have icon sets associated with them and can be modified to your taste.

You can see all of these options by calling

M-x customize-group spaceline-all-the-icons

Custom Segments

You can add your own custom segments to the theme by installing it using the spaceline-all-the-icons-theme function and passing the segment symbols as arguments.

(spaceline-all-the-icons-theme 'your-segment-symbol "Hello" 'etc)

These segments will appear in order on the right side of the mode line, in the empty middle section before all other right aligned segments.

Disabled Segments

Some segments are disabled by default you can turn them on by calling the following in your :config

(spaceline-toggle-all-the-icons-SEGMENT-on)
Segment Description
bookmark Indicates whether the current file is Bookmarked
dedicated Indicates whether the current file is dedicated
fullscreen Indicates whether the frame is Fullscreen
buffer-position Indicates the position through the buffer as a percentage
narrowed Indicates whether the current buffer has been narrowed

Icon Sets

The following segments can have their icon sets customized. You can choose these by calling the following or setting it in :config

M-x customize-group spaceline-all-the-icons-icon-set

(setq spaceline-all-the-icons-icon-set-modified 'toggle)

These segments can have one of the following icon sets

Segment Available Icons
modified chain, toggle, circle
bookmark bookmark, heart, star
dedicated pin, sticky-note
window-numbering circle, solid, string, square
eyebrowse-workspace circle, solid, string, square
multiple-cursors caret, pointer
git-stats diff-icons, arrows
flycheck-slim solid, outline, dots
sun-time rise/set, sun/moon, arrows

Separators

You can customize the divider separators using spaceline-all-the-icons-separator-type, the available types are: 'slant, 'arrow, 'cup, 'wave, 'none

You also have two types of separators between individual segments, these are spaceline-all-the-icons-primary-separator & spaceline-all-the-icons-secondary-separator. Their defualt values are | & · respectively.

Debugging

When a segment throws an error in Spaceline, this causes the entire mode line to disappear (be blank), this is since the mode-line-format throws an error.

Spaceline unfortunately hides a lot of errors internally and doesn't given you information as to which segment is throwing an error.

To debug this, try running

M-x spaceline-all-the-icons--debug-segments
C-u M-x spaceline-all-the-icons--debug-segments

This will (should) return a list of segments which are throwing errors and will help me to debug any issues you're having!

Calling it with a C-u prefix will (should) disable the segments that are currently erroring so that at least the mode line will work.

▲ back to top

About

A Spaceline Mode Line theme using All The Icons for Emacs

License:MIT License


Languages

Language:Emacs Lisp 100.0%