This is the package that provides 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.
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
globalsegment. (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 Spacemacs theme.
To install it, just load
spaceline-config and call the theme function you want. E.g.
(require 'spaceline-config) (spaceline-spacemacs-theme)
There are two themes currently:
spaceline-spacemacs-theme: The theme used by Spacemacs.
spaceline-emacs-theme: A similar theme designed to look good with no other packages installed.
It should work out of the box. This theme integrates with the following third-party packages, which you may consider installing for added benefit:
[eyebrowse](https://github.com/wasamasa/eyebrowse): a simple workspace-like package.
[window-numbering](https://github.com/nschum/window-numbering.el): gives each visible window a number.
[anzu](https://github.com/syohex/emacs-anzu): shows the current match and the total number of matches while searching.
[flycheck](https://github.com/flycheck/flycheck/): shows the number of errors, warnings and notifications after syntax checking.
[erc](http://www.emacswiki.org/emacs/ERC): shows the channels with new messages if you have
[org](http://orgmode.org/): shows the currently clocking task.
[org-pomodoro](https://github.com/lolownia/org-pomodoro): kind of like clocks in org, only with a tomato.
[nyan-mode](https://github.com/TeMPOraL/nyan-mode): shows the current position in the buffer with kittens and rainbows.
[fancy-battery](https://github.com/lunaryorn/fancy-battery.el): shows battery information.
[evil](https://bitbucket.org/lyro/evil/wiki/Home): makes Emacs behave like vim.
There are a number of reasons why Spaceline might look different on your setup compared to Spacemacs proper. Some of the more 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
evil are all not present. If you don't wish to use these packages, there is a theme provided called
spaceline-emacs-theme which is supposed to look good regardless.
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.
If you're using
window-numbering-mode, consider setting
t to get the nice-looking unicode numbers seen in the screenshot.
[diminish](https://github.com/emacsmirror/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
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 segments:
You can bind these to whichever keys you like.
The full list of segments available, from left to right:
workspace-number: integrates with
window-number: integrates with
evil-state: shows the current evil state, integrates with
anzu: integrates with
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-warning: number of flycheck warnings, integrates with
flycheck-info: number of flycheck notifications, integrates with
minor-modes: the currently enabled minor modes. The output of this segment can be tweaked with
process: the background process associated with the buffer, if any.
erc-track: IRC channels with new messages, integrates with
version-control: version control information.
org-pomodoro: integrates with
org-clock: the current org clock, integrates with
nyan-cat: integrates with
battery: integrates with
selection-info: information about the currently active selection, if any.
buffer-encoding-abbrev: the line ending convention used in the current buffer (
point-position: the value of point, this is disabled by default.
line-column: current line and column.
global: meta-segment used by third-party packages.
buffer-position: shows the current position in the buffer as a percentage.
hud: shows the currently visible part of the buffer.
There is also a
buffer-encoding segment, which is not used by the Spacemacs theme.
The highlight face is the face that (by default) is a sharp orange, used e.g. by the HUD segment on the far right, and the first segment on the left (note that it may be invisible if you are using the Spacemacs theme but not some of its optional dependencies). The actual face used as a highlight face is determined by a function, which can be configured by setting the value of
spaceline-highlight-face-func. Spaceline comes with three choices, but of course you can write your own:
spaceline-highlight-face-default: Uses the orange, all the time. This is the default. Hence the name.
spaceline-highlight-face-evil-state: Chooses a face determined by the current evil state. The face corresponding to each state is determined by the association list
spaceline-evil-state-faces, which contains default values for the standard evil states. (Spacemacs has a few more.)
spaceline-highlight-face-modified: Chooses a face determined by the status of the current buffer (modified, unmodified or read-only).
Note that the highlight face is only used in the active window.
In the active window, the mode-line will use these faces:
And in inactive windows:
powerline-default-separator to configure this. The docstring for that variable enumerates the choices.
Each separator comes in two directions: left and right. The variables
spaceline-separator-dir-right specify which directions to alternate between on the left and right side, respectively.
For example, to use only one direction on each side (looks good with the
arrow separator style), you can use
(setq spaceline-separator-dir-left '(left . left)) (setq spaceline-separator-dir-right '(right . right))
By default, the directions alternate between each segment.
原文时间: 2015-09-29 01:54
整理时间: 2015-10-11 02:22
本文由 Hick 整理，转载请保留以上信息;
The articles on this site come from Internet, thanks to all the original authors.
If anything about COPYRIGHT, or LEFT, please contact Emacsist at gmail dot com .