Source Code


A minimal Emacs config that does just enough and nothing more.

Sanemacs sets up a variety of tasteful defaults, MELPA, use-package, and undo-tree to provide for a great out-of-the-box Emacs experience.


Step #1: Download sanemacs.el

mkdir -p ~/.emacs.d; curl > ~/.emacs.d/sanemacs.el

Step #2: Create or modify ~/.emacs.d/init.el

After you have downloaded sanemacs.el, all that's left to do is load it up!

(load "~/.emacs.d/sanemacs.el" nil t)

;;; Your configuration goes below this line.
;;; use-package is already loaded and ready to go!
;;; use-package docs:

View an example Emacs configuration using sanemacs.el


The general rule of keybindings added by Sanemacs is that they may not override default Emacs keybindings. There are four keybindings you should be aware of. Two of which are created by Sanemacs, the other two are from undo-tree. While undo-tree did "override" a default binding, it is appropriate since it is a drop-in replacement that really makes a big difference in the usability of Emacs.

Keybinding Description Emacs command run
Control + > Indents a selection by one tab length indent-rigidly-right-to-tab-stop
Control + < De-indents a selection by one tab length indent-rigidly-left-to-tab-stop
Control + / Undo undo-tree-undo
Control + ? Redo undo-tree-redo

"Layers?" (Sane, minimal layers)

If this package gets traction, a project I would like to create is sanemacs-layers. It would be similar how Spacemacs' layers concept but will have different goals.

First, sanemacs-layers would work on any Emacs configuration, sanemacs or not.

Next, it would have a focus on sane configurations that just work, but are flexible. This would entail automatic detection settings to work for your system - configuring your PythonPath automatically as an example.

View sanemacs.el in browser (With code highlighting!)