Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mclear-tools/bespoke-modeline

A simple custom modeline
https://github.com/mclear-tools/bespoke-modeline

Last synced: 3 months ago
JSON representation

A simple custom modeline

Awesome Lists containing this project

README

        

*NOTE*: I am no longer actively developing this modeline, though its design is now
largely incorporated into [[https://github.com/Lambda-Emacs/lambda-line][Lambda-line]].

#+ATTR_HTML: :width 85%
[[file:screenshots/dark-modeline.png]]
#+ATTR_HTML: :width 85%
[[file:screenshots/light-modeline.png]]

A simple custom modeline for emacs. This started as a fork of [[https://github.com/rougier][Nicolas Rougier's]] excellent
[[https://github.com/rougier/nano-modeline][nano-modeline]], but has evolved somewhat to include several extra (or simply
different) features.

The modeline is less conservative/minimal than nano-modeline, in the sense
that it has a broader color palette and provides more configuration options.

The user is strongly encouraged to use bespoke-modeline with [[https://github.com/mclear-tools/bespoke-themes][bespoke-themes]] (see that
repo for more sample images of the modeline), but it should be, in principle, compatible
with any theme.

** Features/Options

+ The modeline may be set as a header line (similar in style to [[https://github.com/rougier/nano-emacs][nano-emacs]]), or as
the normal footer line, setting =(bespoke-modeline-position)= to top, bottom, or nil.
+ You can set the size of the mode line with =(bespoke-modeline-size)=
+ Set the buffer status symbol in the modeline. This is configurable separately
for GUI and terminal. Default symbols are, respectively, read-only: (⨂)/(RO),
modified: (⨀)/(**), and read-write: (◯)/(RW).
- *NOTE*: If you use symbols you should make sure you are using a font that
will display them properly. Here is one reliable way, using [[https://fontlibrary.org/en/font/symbola][Symbola]] font:
#+begin_src emacs-lisp
(use-package fontset
:straight (:type built-in) ;; only include this if you use straight
:config
;; Use symbola for proper unicode
(when (member "Symbola" (font-family-list))
(set-fontset-font
t 'symbol "Symbola" nil)))
#+end_src
+ Show both vc project and branch in the modeline
+ Set the symbol for vc-mode with =bespoke-modeline-vc-symbol=
and =bespoke-modeline-space-bottom=.
+ Show git diff in modeline with =(bespoke-modeline-git-diff-mode-line)=
+ Substitute any major mode symbol for its designated one by setting
=(bespoke-modeline-cleaner)= to 't (and the related variable
=(bespoke-modeline-cleaner-alist)=
+ Truncate the buffer-name to a specific value (default is 30) using
=(bespoke-modeline-truncate-value)=
+ The modeline is treated as a minor mode, so that it may be toggled on or off with =(bespoke-modeline-mode)=
+ Toggle between the top or bottom mode line with =(bespoke-modeline-toggle)=
+ There is a useful footer line visual alert "bell" inspired by [[https://github.com/hlissner/doom-emacs][DOOM emacs]]. To use
include =(setq bespoke-modeline-visual-bell t)= in your setup of the theme.
+ You can control spacing in the modeline with =bespoke-modeline-space-top=

** Setup

I dont know if/when this will appear on MELPA. In the meantime to use this mode-line
you'll have to clone or otherwise download the repo and put it into your load path.
Here's one possible way of setting it up using [[https://github.com/jwiegley/use-package][use-package]] and [[https://github.com/raxod502/straight.el][straight]].

#+begin_src emacs-lisp
(use-package bespoke-modeline
:straight (:type git :host github :repo "mclear-tools/bespoke-modeline")
:init
;; Set header line
(setq bespoke-modeline-position 'top)
;; Set mode-line height
(setq bespoke-modeline-size 3)
;; Show diff lines in mode-line
(setq bespoke-modeline-git-diff-mode-line t)
;; Set mode-line cleaner
(setq bespoke-modeline-cleaner t)
;; Use mode-line visual bell
(setq bespoke-modeline-visual-bell t)
;; Set vc symbol
(setq bespoke-modeline-vc-symbol "G:")
:config
(bespoke-modeline-mode))
#+end_src