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:

(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.
4 Comments
Thanks for a simple and elegant article. I learned how to center the text in org-mode because I have seen many people centering their text while presenting (for example, System Crafters in YouTube.
I would also like to know how to increase the fonts of sections and subsections. Thanks in advance.
Thank you! The appearance of headings (and a whole bunch of other things) can be customized using
customize-group
:M-x customize-group RET org-faces RET
This will bring up a big list of different faces that can be changed. For section headlines you'll want to modify
Org Level 1
,Org Level 2
etc.More info here: https://orgmode.org/worg/org-tutorials/org-appearance.html
writeroom-mode
exists: https://github.com/joostkremers/writeroom-modeI hadn't heard of
writeroom-mode
, but looks like it handles a lot of this. Thank you for the suggestion!