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.

Alt+x 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 Topic

  1. Font Setup
  2. Proportional Font
  3. Cycle Fonts by Command
  4. Set Line Spacing

If you have a question, put $5 at patreon and message me.
Or Buy Xah Emacs Tutorial
Or buy a nice keyboard: Best Keyboards for Emacs


Emacs Lisp