Emacs: Line Spacing (Line Height)

By Xah Lee. Date: . Last updated: .
emacs line spacing 2020-04-13 jskdz
emacs line spacing 2020-04-13

To set a default line spacing, put this in your Emacs Init File:

(setq-default line-spacing 0.5)

The value can be a integer or decimal number.

Note that the spacing height between lines also depends on font. [see Emacs: Set Font in Init File]

Toggle Line Spacing Command

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

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

put this in your Emacs Init File:

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

Emacs Init

Init Basics

Keys

Font

Text Editing

Completion

File

Restore Things

Backup/AutoSave

Line

Appearance

Misc

Advanced Init Tips

packages