how to increase line spacing in emacs editor

Depending on the font you are using, there are times when you would want to increase the spacing between the lines to make it more readable. The variable that controls the spacing between lines is line-spacing and can executed in the mini-buffer or added to the configuration file.

(setq-default line-spacing 0.25)

The value of the variable can be one of the three types: nil, integer or decimal.

  • If the value is nil, then no extra spacing is added. It can be used to reset a previously set value.
  • If the value is an integer then it is interpreted as a pixel value, and the spacing is added to the bottom of each line.
  • If a decimal or float value is used, then it is considered to be a scaling factor relative to the default line height of the buffer.

As mentioned earlier, you can add it to the emacs configuration file if you want persist the value across buffers and restarts.

Another variable that influence the spacing is line-height which controls the total height of each line displayed. Again this is dependent on the default height of the font that you are using. Using the line height along with the line-spacing, you should be able to configure exactly how want the lines to be displayed.