Minimal mode line configuration for Emacs, inspired by doom-modeline
Go to file
Jessie Hildebrandt a0c84a3c1e Remove obselete face alias definition
3.0.0 broke compatibility with just about everything that may have hooked into
the package, so it should be appropriate to shed this bit of cruft.
2023-12-09 05:13:28 -05:00
.repo-assets Clarify benchmark results 2023-12-06 20:15:14 -05:00
test Fix tests for revised mood-line-defformat macro 2023-11-24 19:23:52 -05:00
ert-test.sh Add tests 2023-11-18 20:29:21 -05:00
LICENSE Add LICENSE 2022-12-22 11:16:23 +00:00
mood-line-segment-checker.el Properly encapsulate byte-compiler declarations 2023-11-24 19:23:55 -05:00
mood-line-segment-indentation.el Properly encapsulate byte-compiler declarations 2023-11-24 19:23:55 -05:00
mood-line-segment-modal.el Restructure project 2023-11-18 20:20:29 -05:00
mood-line-segment-vc.el Merge: handle vc-display-status being nil 2023-12-09 03:13:27 -05:00
mood-line.el Remove obselete face alias definition 2023-12-09 05:13:28 -05:00
README.md Add repository icon 2023-12-04 19:48:45 -05:00

mood-line

A lightweight, drop-in replacement for the default Emacs mode line configuration.

MELPA MELPA Stable

Features

  • Clean, informative design

  • Customizable, modular segment format

  • Customizable glyph sets

  • Lazy-loaded extensions

  • Lightweight, no dependencies

Preview

Preview Image

Configuration

You can install mood-line directly via package-install from MELPA. After installation, you can activate the global minor mode with M-x mood-line-mode. Deactivating mode-line-mode will restore the default mode-line-format.

If you are a user of use-package, it is easy to configure mood-line directly in your init.el:

(use-package mood-line

  ;; Enable mood-line
  :config
  (mood-line-mode)

  ;; Use pretty Fira Code-compatible glyphs
  :custom
  (mood-line-glyph-alist mood-line-glyphs-fira-code))

Format

mood-line uses a modular segment format, and it is easy to reconfigure:

;; Default format:
;;   * init.el  4:32 Top                                         ELisp  ! Issues: 2
(setq mood-line-format mood-line-format-default)

;; Extended format:
;;   * init.el  4:32:52 Top                    SPCx2  LF  UTF-8  ELisp  ! Issues: 2
(setq mood-line-format mood-line-format-default-extended)

;; Custom format:
;;   * init.el : ELisp                                     Top 4:32  |  ! Issues: 2
(setq mood-line-format
      (mood-line-defformat
       :left
       (((mood-line-segment-buffer-status) . " ")
        ((mood-line-segment-buffer-name)   . " : ")
        (mood-line-segment-major-mode))
       :right
       (((mood-line-segment-scroll)             . " ")
        ((mood-line-segment-cursor-position)    . "  ")
        ((when (mood-line-segment-checker) "|") . "  ")
        ((mood-line-segment-checker)            . "  "))))

More information on the format specification is available in the documentation:
M-x describe-variable mood-line-format
M-x describe-function mood-line-defformat

Glyphs

By default, mood-line will use basic ASCII character glyphs to decorate mode line segments. If you'd like to see prettier Unicode glyphs, you can change the value of mood-line-glyph-alist:

;; The default set of glyphs:
;;   * myModifiedFile.js  Replace*3                 + main  JavaScript  ! Issues: 2
(setq mood-line-glyph-alist mood-line-glyphs-ascii)

;; A set of Fira Code-compatible Unicode glyphs:
;;   ● myModifiedFile.js  Replace×3                 + main  JavaScript  → Issues: 2
(setq mood-line-glyph-alist mood-line-glyphs-fira-code)

;; A set of Unicode glyphs:
;;   ● myModifiedFile.js  Replace✕3                 🞤 main  JavaScript  ⚑ Issues: 2
(setq mood-line-glyph-alist mood-line-glyphs-unicode)

If you'd like to supply your own glyphs, you can use the customization interface (M-x customize-variable mood-line-glyph-alist) or view the documentation (M-x describe-variable mood-line-glyph-alist) for more information.

You can further tweak the behavior and appearance of mood-line by viewing the customizable variables and faces in the mood-line and mood-line-faces customization groups. (M-x customize-group mood-line)

Testing

To run the included tests:

./ert-test.sh

Feedback

If you experience any issues with this package, please open an issue on the issue tracker.

Suggestions for improvements and feature requests are always appreciated, as well!