mood-line/README.md

117 lines
3.7 KiB
Markdown
Raw Normal View History

2023-12-05 00:48:45 +00:00
# <img src=".repo-assets/icon.png" width=75> mood-line
A lightweight, drop-in replacement for the default Emacs mode line configuration.
2019-04-11 06:31:21 +00:00
2019-04-23 00:05:10 +00:00
[![MELPA](https://melpa.org/packages/mood-line-badge.svg)](https://melpa.org/#/mood-line)
[![MELPA Stable](https://stable.melpa.org/packages/mood-line-badge.svg)](https://stable.melpa.org/#/mood-line)
2019-04-11 06:31:21 +00:00
## Features
* Clean, informative design
2019-04-11 06:31:21 +00:00
* Customizable, modular segment format
2019-04-11 06:31:21 +00:00
* Customizable glyph sets
2019-04-11 06:31:21 +00:00
* Lazy-loaded extensions
2019-09-30 09:39:12 +00:00
2023-11-21 21:48:59 +00:00
* [Lightweight](.repo-assets/benchmark.md), no dependencies
2019-04-11 06:31:21 +00:00
2019-04-30 13:47:30 +00:00
## Preview
2023-11-19 01:19:33 +00:00
![Preview Image](.repo-assets/preview.png "Preview Image")
2019-04-30 13:47:30 +00:00
2022-12-22 11:12:01 +00:00
## Configuration
You can install mood-line directly via `package-install` from [MELPA](https://melpa.org/).
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:
```elisp
(use-package mood-line
;; Enable mood-line
:config
(mood-line-mode)
;; Use pretty Fira Code-compatible glyphs
:custom
2023-09-23 09:17:26 +00:00
(mood-line-glyph-alist mood-line-glyphs-fira-code))
2022-12-22 11:12:01 +00:00
```
### Format
mood-line uses a modular segment format, and it is easy to reconfigure:
```elisp
;; 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
2023-11-20 22:40:27 +00:00
(mood-line-defformat
:left
(((mood-line-segment-buffer-status) . " ")
2023-11-20 22:40:27 +00:00
((mood-line-segment-buffer-name) . " : ")
(mood-line-segment-major-mode))
:right
2023-11-20 22:40:27 +00:00
(((mood-line-segment-scroll) . " ")
((mood-line-segment-cursor-position) . " ")
((when (mood-line-segment-checker) "|") . " ")
((mood-line-segment-checker) . " "))))
```
2023-11-20 22:40:27 +00:00
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
2022-12-22 11:12:01 +00:00
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`:
```elisp
;; The default set of glyphs:
2023-11-25 00:13:19 +00:00
;; * myModifiedFile.js Replace*3 + main JavaScript ! Issues: 2
2022-12-22 11:12:01 +00:00
(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)
2019-04-12 07:37:02 +00:00
2022-12-22 11:12:01 +00:00
;; A set of Unicode glyphs:
;; ● myModifiedFile.js Replace✕3 🞤 main JavaScript ⚑ Issues: 2
(setq mood-line-glyph-alist mood-line-glyphs-unicode)
```
2019-04-12 07:37:02 +00:00
2022-12-22 11:12:01 +00:00
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.
2019-04-12 07:37:02 +00:00
2022-12-22 11:12:01 +00:00
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`)
2019-04-12 07:37:02 +00:00
## Testing
To run the included tests:
```bash
./ert-test.sh
```
2022-12-20 22:16:32 +00:00
## Feedback
2019-04-11 06:31:21 +00:00
If you experience any issues with this package, please
2023-11-28 02:53:28 +00:00
[open an issue](https://git.tty.dog/jessieh/mood-line/issues/new)
2019-04-11 06:31:21 +00:00
on the issue tracker.
Suggestions for improvements and feature requests are always appreciated, as well!