Olivetti keeps a writing column in the middle of every Emacs window
Emacs minor mode to automatically balance window margins
At a glance
- What is it?
- Olivetti is an Emacs minor mode that sets a text body width and resizes the window margins so prose stays centred, with the width given in characters, as a fraction of the window, or derived from fill-column. Everything it does is buffer-local, so prose and code can sit side by side in the same frame.
- Who is it for?
- Adopt Olivetti if you want a narrow writing column inside a normal Emacs frame rather than a full distraction-free mode, since it changes only the margins and leaves everything else working. Do not adopt it if you want the whole distraction-free environment, since the README points to Writeroom Mode for that and calls Olivetti the smaller option.
- Can I use it commercially?
- Yes, with conditions. GPL-3.0 is a copyleft licence: if you distribute software that includes it, you must release that software's source code under the same licence. Running it internally without distributing it does not trigger that obligation.
- Is it still maintained?
- Yes. The repository last received commits 152 days ago.
- What is it written in?
- Mainly Emacs Lisp, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.
Editorial analysis
The margin is the feature
Olivetti is described as a simple Emacs minor mode for a nice writing environment, and the mechanism is narrow on purpose. You set a desired text body width and the mode automatically resizes the window margins to keep the text comfortably in the middle of the window. Nothing else about the window changes, which is why the README contrasts it with a hardcore distraction-free writing mode. The margins are not decoration, they are how the eye tracks a line in a long measure, and in a wide terminal a long line is genuinely harder to read. The key design decision is that this is a minor mode rather than a major mode, so the buffer keeps its own language mode, your key bindings keep working, and nothing about the editing session changes except the geometry of the window.
Three ways to express the width
The width can be given in three forms, and the choice is not cosmetic. It can be the number of characters as an integer, it can be a fraction of the window width as a float between 0.0 and 1.0, or it can be `nil`, which uses the value of `fill-column` plus 2. The `nil` case is the one that ties the writing column to the rest of your Emacs configuration, since `fill-column` is what already governs where your paragraphs wrap, and following it means the visible column and the wrap point agree. The integer form is for a fixed measure, the float form for a proportional one that follows the window as you resize it. The choice also determines one of the subtler behaviours, which is the next thing to look at.
An integer width scales with text-scale-mode, a float does not
There is a distinction in the documentation that is easy to miss and annoying to discover later. If `olivetti-body-width` is an integer, the text body width will scale with the use of text-scale-mode, whereas if it is a fraction, a float, then the text body width will remain at that fraction. The reason is not hard to reconstruct, since text-scale-mode changes the character size and therefore the number of characters that fit, so a fixed character count has to be recomputed while a fixed fraction of the window does not. In practice that means a floating width is stable when you zoom the text, and an integer width keeps the same number of characters visible. Which one you want depends on whether you are thinking in characters or in proportions of the screen.
Margins, fringes, or both
The visual treatment is configurable through the `olivetti-style` option, which can use margins, fringes, or both for a fancy page look. The distinction between the two is that a margin is empty space inside the text area and a fringe is a strip outside it, which is where Emacs puts the line numbers, the flymake diagnostics and the truncation markers. Using fringes for the effect means you keep the leftmost strip of the window for the mode line and the markers, and the writing column sits in the middle. There is also a customisable `olivetti-fringe` face, and the documentation notes that you can affect only Olivetti buffers with it, so the rest of your Emacs keeps the appearance you already chose.
Everything is buffer-local, which is the point
The line in the README that explains the design is that Olivetti keeps everything it does buffer-local, so you can write prose in one buffer and code in another, side by side in the same frame. That is the feature that makes it usable in a real working session rather than a dedicated writing one. A global mode that centred every window would be unusable in an editing session, since every code buffer would get a narrow column. With buffer-local behaviour, you enable the mode in the buffer where you are writing and it does nothing in the others. The mode also optionally remembers the state of `visual-line-mode` on entry and recalls it on exit, which is a small courtesy that matters when the same buffer is used for both prose and wrapped code.
Interactive width changes and installation
The width can be changed while you are writing, with three commands: `olivetti-shrink` bound to `C-c { { {`, `olivetti-expand` bound to `C-c } } }`, and `olivetti-set-width` bound to `C-c |`. The brace and pipe bindings are the ones you will use, and the grow-shrink pattern means you can narrow the column without a prompt. Installation is through MELPA, with the latest stable release available from MELPA-stable and the possibly unstable one from plain MELPA. You add the archive with `M-x customize-option RET package-archives RET`, inserting an entry named `melpa-stable` with the URL `https://stable.melpa.org/packages/`, then find the package with `M-x list-packages RET`. For a manual install you move the tagged release file into your load-path and add `(require 'olivetti)` to your init file.
The build tooling is for the maintainer
The Makefile says in its first comment that it is for development convenience only and is not required to build or install Olivetti, which is the honest framing for a single-file Emacs Lisp package. It extracts the version from the package header with a grep and turns it into a tag with sed, runs the package linter in batch mode with an emacs started with `-Q`, byte-compiles the file, and has a `tag-release` target that edits the NEWS file, commits it and creates an annotated tag from the first version header. The dependencies are `seq`, `package-lint` and the package machinery itself. The repository itself is small, with the `.gitignore`, a `LICENSE`, the `Makefile`, a `NEWS.md`, the `README.md`, the `olivetti.el` source and a screenshot, and the last push to the master branch was on 2026-05-24.
Editorial conclusion
Adopt Olivetti if you want a narrow writing column inside a normal Emacs frame rather than a full distraction-free mode, since it changes only the margins and leaves everything else working. Do not adopt it if you want the whole distraction-free environment, since the README points to Writeroom Mode for that and calls Olivetti the smaller option. Verify first that your Emacs is 24.4 or newer, and decide whether you want the body width to track text-scale-mode, because the behaviour differs between an integer width and a fractional one.
Frequently asked questions
What does Olivetti do in Emacs?
It is a minor mode that sets a desired text body width and automatically resizes the window margins to keep the text comfortably in the middle of the window. Everything it does is buffer-local.
How do I choose the text body width in Olivetti?
The width can be the number of characters as an integer, a fraction of the window width as a float between 0.0 and 1.0, or `nil`, which uses the value of `fill-column` plus 2.
How do I change the body width while writing in Olivetti?
With `olivetti-shrink` bound to `C-c { { {`, `olivetti-expand` bound to `C-c } } }`, and `olivetti-set-width` bound to `C-c |` for a precise value.
How do I install Olivetti?
Through MELPA or MELPA-stable, by adding the archive URL with `M-x customize-option RET package-archives RET` and then `M-x list-packages RET`. You can also move the tagged release file into your load-path and add `(require 'olivetti)` to your init file.
How does Olivetti interact with text-scale-mode?
If `olivetti-body-width` is an integer the body width scales with text-scale-mode, whereas if it is a fraction the body width remains at that fraction. The requirement is Emacs 24.4 or newer.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/rnkn-olivetti)Was this useful?