POSTS

Setting up fonts in emacs

Setting up fonts in emacs has gotten easier.

In the old days, one would have to dig around for specific details about exactly the right font. With more modern versions of emacs, you can do something like the following in your .emacs file:

(set-face-attribute 'default nil
   :font "DejaVu Sans Mono"
   :height 140
   :weight 'normal
   :width 'normal)

which specifies the font. You can also specify the family instead as with:

(set-face-attribute 'default nil
   :family "Hack" ;; may require 'apt-get install fonts-hack-ttf' first
   :height 140
   :weight 'normal
   :width 'normal)

You may also find it useful to define a function to make a frame with the desired size as part of setting up your fonts.

(defun make-my-frame ()
    "Make a frame so that if you split vertically, windows are each width 80"
    (interactive)
    (make-frame '((width . 164) (height . 40)))
  )

Finally, if you find the big middle scroll bar annoying, you can add or manually execute

(toggle-scroll-bar -1)