This is my ~/.emacs.d
directory. My primary mode of operating is macOS GUI so things work best on that. It is also compatible (but will have more bugs) with running from a terminal, Linux, and Windows.
Nothing should produce unnecessary lag, waiting, or clunkiness. Remote use cases like TRAMP and ssh
have been ironed out through heavy use.
For maximum concentration and ergonomics, there should be no extraneous information. Strip away any distracting lines or unnecessary UI elements.
Slow startup is a barrier to improving this config and it just makes me feel bad. On my machine Emacs starts it up in about 0.8 seconds.
ivy and company are the two main ways to find stuff.
Then mix in the most common macOS key bindings so things like s-c
and s-w
work like in the rest of the OS. I work heavily with macOS applications like Mail, Calendar, Messages, MS Outlook, Firefox. So it’s important that the basic key bindings in those applications have a translation in Emacs. Keep things as consistent and idiomatic as possible while merging these two disparate binding systems.
If I’m not using a package, it’s out. But I guess I use a lot of packages. About 180 at last count. Dependencies bump it up to about 210.
Check out the setup
script. It builds Emacs from the latest master to enjoy benefits such as performance improvements, better macOS compatibility, image viewing, modules like libvterm and pdf-tools, and new features like js-jsx-mode
and Jansson support (see GNU Emacs NEWS, or better yet, M-x view-emacs-news
).
It should work the same way on each machine out of the box with as little fuss as possible.
I update frequently and often pick up new functionality from Emacs master.
Utilize use-package and straight.el for as much configuration as possible.
Defer loading non-core packages until they are needed. Straight is an amazing package management system that does everything better than package.el.
It’s a customized version of mood-line.
Quickly (and completely!) switch between light and dark, or any other themes. A key part of this is realizing that many packages have dependencies on the theme so it is not nearly enough to call load-theme
. So there is some additional logic to automatically change as much as possible and use a hook to do the rest.
Highlights include
- undo-tree
- Multiple cursors
- Parinfer
- Smartparens with lots of customization
macOS doesn’t hand its applications much in terms of standard UNIX environment configuration. I have a customized setup to initialize the environment by running bash --login
and pulling in its environment variables. The details are handled in my non-Emacs dotfiles.
There is nothing like Eshell. It is truly amazing the way it enables powerful new ways to handle remote systems administration. There are extensive customizations to make it seamless with the rest of the environment and UI.
Make the uniquely powerful Dired more comfortable, informative, and reliable. Heavily reliant on the awesome dired-hacks collection.
Manage window configuration and buffer persistence using perspective, undo, command completions, recent files, etc.
Some innovative intra- and extra- buffer navigation strategies. Check out winner-wrong-window
for an example.
Magit and more. But mostly magit.
- Bash and friends
- C# by way of omnisharp
- Clojure and Clojurescript
- Common Lisp
- Docker
- Emacs Lisp of course, with many enhancements.
- lsp-mode
- Lua
- Org customizations
- Python
- Ruby
- Scheme (mostly CHICKEN)
- Web, Javascript and React development
- Automatic code formatting, mostly with Apheleia
- flycheck
- Log viewing - Docker, systemd, and others
- Nested language support with fence-edit
Attempts have been made to make this config compatible with 27+. However, they are half-hearted and some features are 28+ or maybe even 29+ only.
- Clone the repo:
git clone https://github.com/mnewt/dotemacs.git ~/.emacs.d
- Install Emacs
You can install Emacs using your method of choice but I build it from source:
~/.emacs.d/bin/build-emacs
- Start Emacs. The first run will install lots of stuff so it will take a few minutes.
You can build Emacs with support for compiling packages to machine code using GCCEmacs. As of Emacs 28, this is an optional feature that seems to work pretty well. Currently, I’m using homebrew-emacs-plus.
See the install-emacs-plus script for how I build Emacs on macOS.
See TODO.org.
The Free Software Foundation may control certain pieces of this by virtue of them being contributed to Emacs or a package in ELPA. The rest is basically in the public domain. See the LICENSE file for details.