“The Dao that can be spoken is not the Eternal Dao. A mode that may be seen is soon in need of reformation.”
When thou openest Emacs, and beholdest a line wrought by Shaoline, know: thy gaze hath been too intent. The True Shaoline leaves behind no trace. The line appears only at those times when the Eternal Empty Buffer heaves a sigh: is aught worth utterance?
(use-package shaoline
:ensure t
:config
(shaoline-mode 1))
or for those who use not use-package:
(require 'shaoline)
(shaoline-mode 1)
No child-frame, nor window-modeline—the Shaoline line dances solely within the echo area, untroubled by the tumult of the outer interface.
- Minimalism: The Shaoline line arises only when there is aught to say.
- Segments are by nature simple: Each—forlorn, pure, unfastened by worldly things—disturbs not a neighbour.
- Effortless Configuration: Nothing concealed, all open before thee.
- Time doth Flow: Only as the rain upon the lattice does Shaoline update—stirred by event, never haste.
- Transparency and Cheer: In Shaoline containeth nothing that may not be grasped or altered, provided thy spirit be light.
- Simplicity and Candour: The settings are clear as morning tea sipped in the Valley of Wei.
- Beautiful icons: For vivid file/mode/project icons, install all-the-icons (see FAQ).
“The master divides not the line each portion stands apart. Yet together they form the path of Shaoline.”
Segments in Shaoline are as monks in silent brotherhood, each close to the Void, yet clinging not to his neighbour:
(setq shaoline-segments
'((:left shaoline-segment-icon-and-buffer shaoline-segment-git-branch)
(:center shaoline-segment-echo-message)
(:right shaoline-segment-project-name shaoline-segment-battery shaoline-segment-time)))
Arrange them as stones in a garden: remove, replace, or add—freely, unafraid.
Variable | Description |
---|---|
shaoline-segments | Controls the display order of line segments |
shaoline-autohide-modeline | Hides the default mode-line if t |
shaoline-timer-interval | How often Shaoline updates timed segments |
shaoline-message-timeout | How long before Shaoline resumes after a message |
shaoline-update-hooks | What events trigger Shaoline updates |
To see and change all customization options in an interactive interface:
M-x customize-group RET shaoline RET
(setq shaoline-segments
'((:left shaoline-segment-icon-and-buffer shaoline-segment-git-branch)
(:center)
(:right)))
Classic: Custom right segment, removing others:
(setq shaoline-segments
'((:left)
(:center)
(:right shaoline-segment-time)))
Full custom list (project → git → time):
(setq shaoline-segments
'((:left shaoline-segment-project-name)
(:center)
(:right shaoline-segment-git-branch shaoline-segment-time)))
“The Way is ever simple: let thy function return a string.”
Softly and simply, fashion a custom segment:
(shaoline-define-segment shaoline-segment-buffer-size (buffer)
"Displays the buffer size."
(format "%.1fK" (/ (buffer-size buffer) 1024.0)))
(push 'shaoline-segment-buffer-size (alist-get :right shaoline-segments))
Or, as a mode segment example:
(shaoline-define-segment shaoline-segment-buf-modes (buffer)
"Shows active major and minor modes."
(format "%s %s"
(format-mode-line mode-name)
(mapconcat #'identity minor-mode-alist " ")))
(push 'shaoline-segment-buf-modes (alist-get :right shaoline-segments))
To remove all default segments, simply do:
(setq shaoline-segments '((:left) (:center) (:right)))
“When the cup runneth over— the master sips tea and troubles not the stream.”
A peculiar wisdom: Shaoline manifesteth itself only if the echo area is void. Any Emacs message taketh precedence—Shaoline yields with humility.
Should enlightenment evade thee, seek thus:
- Turn on
shaoline-debug
((setq shaoline-debug t)
), and consult*shaoline-logs*
. - Temporarily disable other echo-area or mode-line packages—they may conflict.
- Ensure
(shaoline-mode 1)
is called after desired UI tweaks. - Toggle hiding of the classic mode-line:
M-x customize-variable RET shaoline-autohide-modeline
or(setq shaoline-autohide-modeline nil)
- Where is my mode-line? Where Shaoline is not, in Nirvana. Desire it, and it shall return.
- Shaoline vanishes! Is this enlightenment? Shouldst the echo-area be occupied, Shaoline falleth silent. He waiteth until the void resumes, and only then doth he arise once more.
- I desire my own segment: what is to be done? A function (buffer) → string, registered through shaoline-define-segment—thou art a master already.
- How can I debug Shaoline?
Enable
shaoline-debug
, and the entire journey of lines and errors shall be inscribed in the buffer*shaoline-logs*
.
shaoline-segments
– Describeth the structure of the line: leftmost, centre, rightmost.shaoline-autohide-modeline
– In truth, the mode-line departeth.shaoline-update-hooks
– Hooks for the reactivity that bringeth renewal.shaoline-timer-interval
– The interval for wise renewal of time and battery.shaoline-message-timeout
– For how many seconds a mortal message abideth before Shaoline’s return.
Project | Echo Area | Modeline Hide | Segments as Functions | Timers/Polling | Minimal Dependencies |
---|---|---|---|---|---|
Shaoline | Yes | Yes | Yes | No | Yes |
doom-modeline | No | Optional | Mostly | Yes | No |
smart-mode-line | No | Optional | No | Yes | No |
telephone-line | No | Optional | Partial | Yes | No |
Shaoline is for those who seek serenity and emptiness—the Echo-area only; no in-window extravagance.
Segment name | Description | Appearance |
---|---|---|
shaoline-segment-icon-and-buffer | buffer icon and name | README.org (icon + buffer name) |
shaoline-segment-git-branch | Current Git branch | branch icon + name |
shaoline-segment-project-name | Project’s name (projectile/project.el) | “my-project” |
shaoline-segment-battery | Battery state | 95% 🔋 |
shaoline-segment-time | Time (hour:minute) | 09:21 |
shaoline-segment-echo-message | Echo message if any | … |
- Integrates smoothly with projectile and project.el
- Compatible with use-package and straight.el
- Works best with Emacs 27+
- Issues and wishes: GitHub |11111000000/shaoline
Questions, bug reports, or suggestions welcome via [GitHub issues](https://github.com/11111000000/shaoline) or mail: 11111000000@email.com
“Do thine own task—then know contentment. Shaoline appeareth when it is needful, And should it vanish—so is the Way.”
To carry the line, carrying it not—a perfection indeed!