8000 GitHub - 11111000000/shaoline: shaoline-mode
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

11111000000/shaoline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
< 8000 div data-testid="latest-commit-details" class="d-none d-sm-flex flex-items-center">

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shaoline-mode: The Path of the Line

“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?

Quick Start

(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.

Features

  • 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).

Teachings on Segments

“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.

Variables at a Glance

VariableDescription
shaoline-segmentsControls the display order of line segments
shaoline-autohide-modelineHides the default mode-line if t
shaoline-timer-intervalHow often Shaoline updates timed segments
shaoline-message-timeoutHow long before Shaoline resumes after a message
shaoline-update-hooksWhat events trigger Shaoline updates

Configuration Examples

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)))

Creating Custom Segments

“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)))

The Freedom of the Echo Area

“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.

Troubleshooting

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)

FAQ

  • 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*.

Esoteric Knowledge

  • 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.

Comparison

ProjectEcho AreaModeline HideSegments as FunctionsTimers/PollingMinimal Dependencies
ShaolineYesYesYesNoYes
doom-modelineNoOptionalMostlyYesNo
smart-mode-lineNoOptionalNoYesNo
telephone-lineNoOptionalPartialYesNo

Shaoline is for those who seek serenity and emptiness—the Echo-area only; no in-window extravagance.

Default Segments

Segment nameDescriptionAppearance
shaoline-segment-icon-and-bufferbuffer icon and name README.org (icon + buffer name)
shaoline-segment-git-branchCurrent Git branchbranch icon + name
shaoline-segment-project-nameProject’s name (projectile/project.el)“my-project”
shaoline-segment-batteryBattery state95% 🔋
shaoline-segment-timeTime (hour:minute)09:21
shaoline-segment-echo-messageEcho message if any

Related

  • 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

Feedback

Questions, bug reports, or suggestions welcome via [GitHub issues](https://github.com/11111000000/shaoline) or mail: 11111000000@email.com

Illustration

screenshot-shaoline.png

“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!

About

shaoline-mode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0