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 Configuration.

Font/Unicode Topic

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

  1. Best Unicode Fonts for Programer
  2. Emacs: Font Configuration
  3. Emacs: Proportional Font
  4. Emacs: Cycle Fonts by Command
  5. Emacs: Set Line Spacing
  6. Emacs: toggle-word-wrap
  7. Elisp: Unicode Representation in String
Liket it? Put $1 at patreon. Or Buy Xah Emacs Tutorial. Thanks.