Airline Themes

about | blog | config | notes | github

1. Custom Themes for Powerline

airline-themes provides custom themes for Powerline.

2. Configuration

2.1. Setup Dependencies

We need to make sure Powerline is setup first.

(require 'init-powerline)

2.2. Package Install

(use-package airline-themes
  :disabled)

2.3. Setup Theme

(with-eval-after-load 'airline-themes
  (load-theme 'airline-dark t))

2.4. Customize Options

Hide Evil and buffer state on inactive buffers:

  • Valid Values: t (hidden), nil (shown)
(setq airline-hide-state-on-inactive-buffers nil)

Hide eyebrowse indicator on inactive buffers.

  • Valid Values: t (hidden), nil (shown)
(setq airline-hide-eyebrowse-on-inactive-buffers nil)

Hide vc branch on inactive buffers:

  • Valid Values: t (hidden), nil (shown)
(setq airline-hide-vc-branch-on-inactive-buffers nil)

Set eshell prompt colors to match the airline theme.

  • Valid Values: t (enabled), nil (disabled)
(setq airline-eshell-colors nil)

Set helm colors to match the airline theme:

  • Valid Values: t (enabled), nil (disabled)
(setq airline-helm-colors t)

Set the cursor color based on the current evil state:

  • Valid Values: t (enabled), nil (disabled)
(setq airline-cursor-colors t)

Display the currend directory along with the filename.

  • Valid Values: 'airline-directory-full 'airline-directory-shortened nil (disabled)
(setq airline-display-directory 'airline-directory-shortened)

Max directory length to display when using 'airline-directory-shortened

(setq airline-shortened-directory-length 30)

Unicode character choices

(setq airline-utf-glyph-separator-left #xe0b0)
(setq airline-utf-glyph-separator-right #xe0b2)
(setq airline-utf-glyph-subseparator-left #xe0b1)
(setq airline-utf-glyph-subseparator-right #xe0b3)
(setq airline-utf-glyph-branch #xe0a0)
(setq airline-utf-glyph-readonly #xe0a2)
(setq airline-utf-glyph-linenumber #x2630)

You may also wish to force powerline to use utf8 character separators:

  • Valid Values: alternate, arrow, arrow-fade, bar, box, brace, butt, chamfer, contour, curve, rounded, roundstub, wave, zigzag, slant, utf-8.
(setq powerline-default-separator 'arrow)
(setq powerline-utf-8-separator-left  #xe0b0)
(setq powerline-utf-8-separator-right #xe0b2)

2.5. Feature Provide

(provide 'init-airline-themes)

Created: 2021-11-13

Emacs 26.1 (Org mode 9.5)