I use Emacs for all of my writing (including this blog). For a long time I used the default environment, but I really missed the more focused approach of applications like WriteRoom. So a few years ago I made an effort to streamline my Emacs writing environment.

With a few additional modes - and a small amount of elisp - I was able to get Emacs looking like this:

Writing this post with Emacs

(The theme is doom-nord and font is Ubuntu.)

It's a fairly simple setup with only a few different parts.

Removing distracting UI elements

I don't think a toolbar or menu is particularly distracting, but it's visual clutter that I don't use. This code comes from my minimal Emacs configuration and hides these elements:

;; Hide the menu bar, tool bar, and scroll bars.
(when (fboundp 'menu-bar-mode)   (menu-bar-mode   -1))
(when (fboundp 'tool-bar-mode)   (tool-bar-mode   -1))
(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))

Centering and enlarging the text

The majority of my writing is done inside org-mode, but I also use org-mode to manage projects so I don't want every buffer to use these settings. For writing projects I use a .dir-locals.el file to automatically enable specific modes and to increase the font size.

((org-mode . ((eval . (progn (turn-off-auto-fill)
			     (text-scale-set 1)))
	      (fill-column              . 80)
	      (visual-fill-column-width . 80)
	      (olivetti-body-width      . 80)
	      (mode . olivetti)
	      (mode . visual-line)
	      (mode . visual-fill-column))))

The code in the eval block turns off hard-wrapping, increases the font size, and enables olivetti-mode.

I use olivetti to narrow the writing area to 80 characters which I find easier to work with. darkroom is a good alternative to olivetti; it provides similar functionality, but also more options and can even set an entirely different font face when enabled.

2021-08-11 edit - Updated .dir-locals.el with new activation as olivetti has removed the turn-on-olivetti-mode function.

If you found this helpful and would like to read more content like it, follow me on Twitter.