Spaceline
Powerline theme from Spacemacs
Install / Use
/learn @TheBB/SpacelineREADME
#+TITLE: Spaceline
[[https://melpa.org/#/spaceline][http://melpa.org/packages/spaceline-badge.svg]] [[https://stable.melpa.org/#/spaceline][https://stable.melpa.org/packages/spaceline-badge.svg]] [[https://travis-ci.org/TheBB/spaceline][https://travis-ci.org/TheBB/spaceline.svg]] [[https://github.com/syl20bnr/spacemacs][file:https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg]]
- Contents :TOC_2_gh:
- [[#introduction][Introduction]]
- [[#the-default-themes][The default themes]]
- [[#optional-dependencies][Optional dependencies]]
- [[#troubleshooting][Troubleshooting]]
- [[#moderate-configuration][Moderate configuration]]
- [[#turning-segments-on-and-off][Turning segments on and off]]
- [[#the-highlight-face][The highlight face]]
- [[#other-faces][Other faces]]
- [[#powerline-separators][Powerline separators]]
- [[#hooks][Hooks]]
- [[#unicode-numbers][Unicode numbers]]
- [[#minor-modes-separator][Minor modes separator]]
- [[#org-clock][Org clock]]
- [[#deep-configuration][Deep configuration]]
- [[#segments][Segments]]
- [[#defining-a-segment][Defining a segment]]
- [[#properties][Properties]]
- [[#bindings][Bindings]]
- [[#compiling-a-mode-line][Compiling a mode-line]]
- [[#tweaking-or-defining-your-own-mode-line][Tweaking or defining your own mode-line]]
- Introduction This is the package that provides [[http://spacemacs.org/][Spacemacs]] with its famous mode-line theme. It has been extracted as an independent package for general fun and profit.
This package provides features for three kinds of users.
- You just want to use the Spacemacs mode-line theme and forget about it.
- You want to use something similar to the Spacemacs mode-line theme, but with a handful of easy tweaks.
- You want an easy-to-use library for building your own mode-line from scratch, and you think the Spacemacs theme looks good.
The functionality for each are described in the following sections.
The files in this package are organized as follows. Choose which you want to load based on what you want to do.
- =spaceline.el=: Contains the core library used to define segments and render the modeline. It defines no segments by itself except the =global= segment. (See below.)
- =spaceline-segments.el=: Defines all the segments used by the default Spacemacs theme, but doesn’t do anything with them.
- =spaceline-config.el=: Defines the default themes.
- The default themes To install it, just load =spaceline-config= and call the theme function you want. E.g.
#+BEGIN_SRC emacs-lisp (require 'spaceline-config) (spaceline-spacemacs-theme) #+END_SRC
The package comes bundled with two themes:
- =spaceline-spacemacs-theme=: The theme used by Spacemacs
- =spaceline-emacs-theme=: A theme which is similar to the one used by Spacemacs, but which has been designed to look good without the dependencies that the Spacemacs theme needs.
In addition, Spaceline supports custom themes for Info+ and Helm. These can be enabled through global minor modes:
- =spaceline-helm-mode=
- =spaceline-info-mode= (requires the [[http://www.emacswiki.org/emacs/InfoPlus][info+]] package)
These are also defined in =spaceline-config.el=.
** Optional dependencies These themes include several segments that depend on third-party packages. If these packages are not installed, these segments will be invisible and not show any output. As such, they can be considered /optional/ dependencies.
Here follows a brief list of these dependencies. For more information consult the upstream sources.
*** Persp-mode [[https://github.com/Bad-ptr/persp-mode.el][Persp-mode]] is a powerful workspace-like package. Spaceline shows the current workspace name.
*** Eyebrowse [[https://github.com/wasamasa/eyebrowse][Eyebrowse]] is a simpler workspace-like package. If it is installed, The Spacemacs theme will show the current workspace number. The Emacs theme uses the workspace number as a fallback for the perspective name: thus if persp-mode is installed, the Eyebrowse workspace will not be shown.
*** Winum [[https://github.com/deb0ch/winum.el][Winum]] shows a number for each window, and it works with both themes.
To prevent =winum= from inserting its own number in the mode-line, you have to set =winum-auto-setup-mode-line= to nil before activating =winum-mode=:
#+BEGIN_SRC emacs-lisp (setq winum-auto-setup-mode-line nil) (winum-mode) #+END_SRC
*** Auto-compile [[https://github.com/tarsius/auto-compile][Auto-compile]] automatically compiles Emacs Lisp files on save if there is an older byte-compiled file. Spaceline shows warnings when they occur.
*** Anzu [[https://github.com/syohex/emacs-anzu][Anzu]] shows the current match and the total number of matches while searching.
Note that Anzu inserts itself in the modeline, to let spaceline handle the modeline, make sure to =(setq anzu-cons-mode-line-p nil)= or customize it.
*** Flycheck [[https://github.com/flycheck/flycheck/][Flycheck]] is a powerful syntax-checking package. Spaceline shows errors, warnings and notifications from it.
*** ERC [[http://www.emacswiki.org/emacs/ERC][ERC]] is an IRC client built in to Emacs. Spaceline shows channels with new messages if you have =erc-track= turned on.
*** Org Spaceline shows the currently clocking [[http://orgmode.org/][org-mode]] task.
*** Org-pomodoro Spaceline integrates with [[HTtps://github.com/lolownia/org-pomodoro][org-pomodoro]] by showing its clocks.
*** Python virtual environments The currently active environments as reported by [[https://github.com/proofit404/pyenv-mode][pyenv-mode]] or [[https://github.com/jorgenschaefer/pyvenv][pyvenv]] are shown in Spaceline.
*** Nyan cat [[https://github.com/TeMPOraL/nyan-mode][Nyan-mode]] shows the current position in the buffer with kittens and rainbows.
*** Fancy battery [[https://github.com/lunaryorn/fancy-battery.el][Fancy-battery]] shows battery information in the modeline.
*** Evil [[https://bitbucket.org/lyro/evil/wiki/Home][Evil]] makes Emacs behave like Vim. The first segment in the Spacemacs theme shows the current Evil state if all the other dependencies do not report information (i.e. no perspective, workspace or window number). The Emacs theme does not include any information from Evil.
You can color the modeline according to the current Evil state by setting =spaceline-highlight-face-func= to =spaceline-highlight-face-evil-state=.
** Troubleshooting There are a number of reasons why Spaceline might look different on your setup compared to Spacemacs proper. Some of the most important ones are addressed here.
-
You’re missing an optional dependency. Spacemacs includes packages that display information in the mode-line. The leftmost segment is invisible if =eyebrowse-mode=, =persp-mode=, =window-numbering-mode= and =evil= are all not present. If you don’t wish to use these packages, consider using the Emacs theme.
-
Consider setting or increasing the value of =powerline-height= to give your mode-line some room to breathe.
-
The default powerline separator is =arrow=, but Spacemacs uses =wave=. You should try out various settings of =powerline-default-separator= to find the one that works for you. Note that you need to recompile the modeline with =M-x spaceline-compile= after setting this variable.
-
If you’re using =eyebrowse-mode= or =window-numbering-mode=, consider setting =spaceline-workspace-numbers-unicode= and =spaceline-window-numbers-unicode= to =t= to get the nice-looking unicode numbers seen in the screenshot.
-
Use [[https://github.com/emacsmirror/diminish][Diminish]] to tweak the output of the minor modes segment.
-
To get the mode-line highlight to change color depending on the evil state, set =spaceline-highlight-face-func= to =spaceline-highlight-face-evil-state=.
- Moderate configuration
** Turning segments on and off Each segment has a variable =spaceline-NAME-p= that can switch the segment off by setting it to =nil=. There are also three convenient interactive functions for toggling:
- =spaceline-toggle-<name>=
- =spaceline-toggle-<name>-on=
- =spaceline-toggle-<name>-off=
These can be bound to whichever keys you like.
Here is a complete list of segments bundled with Spacemacs.
- =persp-name=: integrates with =persp-mode=.
- =workspace-number=: integrates with =eyebrowse=.
- =window-number=: integrates with =window-numbering=.
- =evil-state=: shows the current evil state, integrates with =evil=.
- =anzu=: integrates with =anzu=.
- =auto-compile=: integrates with =auto-compile=.
- =buffer-modified=: the standard marker denoting whether the buffer is modified or not.
- =buffer-size=: the size of the buffer.
- =buffer-id=: the name of the buffer.
- =remote-host=: the host for remote buffers.
- =major-mode=: the current major mode.
- =flycheck-error=: number of flycheck errors, integrates with =flycheck=.
- =flycheck-warning=: number of flycheck warnings, integrates with =flycheck=.
- =flycheck-info=: number of flycheck notifications, integrates with =flycheck=.
- =minor-modes=: the currently enabled minor modes. The output of this segment can be tweaked with [[https://github.com/emacsmirror/diminish][Diminish]].
- =process=: the background process associated with the buffer, if any.
- =erc-track=: IRC channels with new messages, integrates with =erc=.
- =version-control=: version control information.
- =org-pomodoro=: integrates with =org-pomodoro=.
- =org-clock=: the current org clock, integrates with =org=.
- =nyan-cat=: integrates with =nyan-mode=.
- =battery=: integrates with =fancy-battery-mode=.
- =which-function=: integrates with =which-function-mode=.
- =python-pyvenv=: integrates with =pyvenv=.
- =python-pyenv=: integrates with =pyenv=.
- =paradox-menu=: integrates with =paradox=.
- =selection-info=: information about the currently active selection, if any.
- =input-method=: shows the current act
