Emacs Init: Variable Pitch Mode (Proportional Font)

By Xah Lee. Date: .

Setup Proportional Font by Major Mode

Here's how to make some Major Mode always use proportional font.

Put this in your Emacs Init File:

  ;; use variable-width font for some modes
  (defun xah-use-variable-width-font ()
    "Set current buffer to use variable-width font."
    (variable-pitch-mode 1)
    ;; (text-scale-increase 1 )
  (add-hook 'nxml-mode-hook 'xah-use-variable-width-font)
  (add-hook 'emacs-lisp-mode-hook 'xah-use-variable-width-font)
  (add-hook 'js-mode-hook 'xah-use-variable-width-font)
  (add-hook 'css-mode-hook 'xah-use-variable-width-font)
  (add-hook 'html-mode-hook 'xah-use-variable-width-font)
  (add-hook 'mhtml-mode-hook 'xah-use-variable-width-font))

Emacs Monospace, Proportional Font

Emacs Font Setup