:ui modeline

Snazzy, Atom-inspired modeline, plus API

1. Description

This module provides an Atom-inspired, minimalistic modeline for Doom Emacs, powered by the doom-modeline package (where you can find screenshots).

1.2. Module flags

+light
Enable a lighter and faster, but less featureful, version of the modeline that does not depend on doom-modeline.

1.4. Hacks

No hacks documented for this module.

2. Prerequisites

This module has no external prerequisites.

3. TODO Usage

This module’s usage documentation is incomplete. Complete it?

3.1. TODO Hiding the modeline

3.2. TODO Switching the modeline and header line

4. TODO Configuration

This module’s configuration documentation is incomplete. Complete it?

4.1. TODO Changing the default modeline

4.2. TODO Activating a format

4.3. TODO Defining a modeline format

4.4. TODO Defining a modeline segment

4.5. TODO Extracting Doom’s modeline into your config

5. Troubleshooting

5.1. Where are my minor modes?

I rarely need to know what minor modes are active, so I removed them. M-x doom/describe-active-minor-mode was written to substitute for it.

5.2. TODO Icons in my modeline look strange

5.3. TODO The right side of the modeline is cut off

The consensus is: this is due to oversized icons, i.e. a font issue. Some possible solutions:

  1. Tweak all-the-icons-scale-factor (1.2 by default): (setq all-the-icons-scale-factor 1.1)
  2. Add some padding to the modeline definition:

    (after! doom-modeline
      (doom-modeline-def-modeline 'main
        '(bar matches buffer-info remote-host buffer-position parrot selection-info)
        '(misc-info minor-modes checker input-method buffer-encoding major-mode process vcs "  "))) ; <-- added padding here
    
  3. Use another font for the mode line (or a different :height):

    (custom-set-faces!
      '(mode-line :family "Noto Sans" :height 0.9)
      '(mode-line-inactive :family "Noto Sans" :height 0.9))
    

    (Mentioned in #1680, #278 and seagle0128/doom-modeline#334)

  4. Change the width of icon characters in char-width-table:

    (add-hook! 'doom-modeline-mode-hook
      (let ((char-table char-width-table))
        (while (setq char-table (char-table-parent char-table)))
        (dolist (pair doom-modeline-rhs-icons-alist)
          (let ((width 2)  ; <-- tweak this
    	    (chars (cdr pair))
    	    (table (make-char-table nil)))
    	(dolist (char chars)
    	  (set-char-table-range table char width))
    	(optimize-char-table table)
    	(set-char-table-parent table char-table)
    	(setq char-width-table table)))))
    

    If this doesn’t help, try different values for width such as 1 or 3.

6. Appendix

6.1. Autodefs

  • def-modeline-format! NAME LEFT &optional RIGHT
  • def-modeline-segment! NAME &rest REST
  • set-modeline! NAME &optional DEFAULT

6.2. Variables

  • doom-modeline-height
  • doom-modeline-bar-width
  • doom-modeline-buffer-file-name-style
  • doom-modeline-icon
  • doom-modeline-major-mode-icon
  • doom-modeline-major-mode-color-icon
  • doom-modeline-buffer-state-icon
  • doom-modeline-buffer-modification-icon
  • doom-modeline-minor-modes
  • doom-modeline-enable-word-count
  • doom-modeline-buffer-encoding
  • doom-modeline-indent-info
  • doom-modeline-checker-simple-format
  • doom-modeline-vcs-max-length
  • doom-modeline-persp-name
  • doom-modeline-lsp
  • doom-modeline-github
  • doom-modeline-github-interval
  • doom-modeline-env-version
  • doom-modeline-mu4e
  • doom-modeline-irc
  • doom-modeline-irc-stylize

6.3. Faces

  • doom-modeline-buffer-path
  • doom-modeline-buffer-file
  • doom-modeline-buffer-modified
  • doom-modeline-buffer-major-mode
  • doom-modeline-buffer-minor-mode
  • doom-modeline-project-parent-dir
  • doom-modeline-project-dir
  • doom-modeline-project-root-dir
  • doom-modeline-highlight
  • doom-modeline-panel
  • doom-modeline-debug
  • doom-modeline-info
  • doom-modeline-warning
  • doom-modeline-urgent
  • doom-modeline-unread-number
  • doom-modeline-bar
  • doom-modeline-inactive-bar
  • doom-modeline-evil-emacs-state
  • doom-modeline-evil-insert-state
  • doom-modeline-evil-motion-state
  • doom-modeline-evil-normal-state
  • doom-modeline-evil-operator-state
  • doom-modeline-evil-visual-state
  • doom-modeline-evil-replace-state
  • doom-modeline-persp-name
  • doom-modeline-persp-buffer-not-in-persp