Emacs: Set Line Spacing

By Xah Lee. Date: . Last updated: .

How to set line spacing?

You can change line spacing by setting the variable line-spacing.

For example: call eval-expression then type (setq line-spacing 0.5)

the value can be a integer or decimal number.

Toggle Line Spacing Command

Here's a command that lets you toggle line spacing between 2 values.

(defun xah-toggle-line-spacing ()
  "Toggle line spacing between no extra space to extra half line height.
URL `http://ergoemacs.org/emacs/emacs_toggle_line_spacing.html'
Version 2017-06-02"
  (if line-spacing
      (setq line-spacing nil)
    (setq line-spacing 0.5))
  (redraw-frame (selected-frame)))

This is useful for switching between reading source code and reading novels. [see Emacs: Novel Reading Mode]

Note that the spacing height between lines also depends on font. See: Emacs: Font Setup.

Font/Unicode Topic

  1. Unicode Tutorial
  2. Emacs File Encoding FAQ
  3. Unicode Basics: What's Character Set, Character Encoding, UTF-8?
  4. Xah Math Input Mode
  5. Xah Unicode Browser Mode

  1. Best Unicode Fonts for Programer
  2. Font Setup
  3. Proportional Font
  4. Cycle Fonts by Command
  5. Set Line Spacing
  6. toggle-word-wrap
  7. Elisp: Unicode Representation in String
Patreon me $5 patreon

Or Buy Xah Emacs Tutorial

Or buy a nice keyboard: Best Keyboards for Emacs

If you have a question, put $5 at patreon and message me.