Skip to content

precompute/CleanEmacs

Repository files navigation

CleanEmacs

.assets/logo.png

[23-06-14 21:38:16]

This is my personal Emacs config. I migrated from DOOM because updating it was a hassle owing to my extensive config.

I’ve been using Doom Emacs for four years, and I wanted my config to be a lighter version of the same. Hence, I’ve tried to stick as close to the keybinds I’m used to. Other parts of this config also offer Doom-like functionality.

We don’t aim this config to be minimal, but instead to be easy to understand.

Recommended Emacs Version
31.0.50
Current Emacs commit
4fada67748db787bf3a08ff15f1ab6f7992f9a7e
Recommended OS
I use Debian Stable. This config might work on MacOS and WSL. I don’t use either, so no guarantees.

Configured with:

configure --with-native-compilation=aot 'CFLAGS=-flto -O3
-mtune=native -march=native -fomit-frame-pointer' --enable-autodepend
--enable-link-time-optimization --with-dbus --with-gif --with-gnutls
--with-gpm=no --with-imagemagick --with-jpeg --with-json
--with-libotf --with-mailutils --with-modules
--without-compress-install --without-gconf --without-gsettings
--without-xaw3d --with-png --with-sound --with-sqlite3 --with-tiff
--with-toolkit-scroll-bars --with-webp --with-xft --with-xim
--with-xpm --with-tree-sitter --with-x-toolkit

General Outline

Hierarchy

/
early-init.el
Sets some defaults, calls early-init-ui.el
early-init-ui.el
Defines some faces for modeline.el and disables the menu bar and other stuff.
init.el
Only loads files. Loads elpaca-init.el first, and other package-agnostic configuration files are called after.
elpaca-init.el
Load elpaca and set some custom vars with cache / user directory locations
general.el
Defines emacs-wide user options and enables some global minor-modes.
functions.el
Dumping ground for functions and Transients.
keybinds.el
Defines keybinds, uses general-def.
hooks.el
Hooks that are too general to warrant a separate file.
ui.el
Sets the theme, fonts and modifies a few faces.
headerline-simple.el
A simplified version of archive/modeline-simple.el, which is a refactored version of archive/modeline.el that doesn’t slow the editor down and only computes changes when it doesn’t affect editing speed (faciliated by while-no-input). Uses a whitelist of modes, so unsupported modes show the default mode-line. Uses :box in propertize so it might shift your window just a little. You’ll get used to it. It also computes colors from the active theme, doesn’t use the default mode-line face provided by a theme.
modes.el
For treesit configuration.
loads.el
Loads files that aren’t tracked in this project.
.private
Ignored folder for any elisp you’d want to include.
archive
For archived files
import
One-off, “foreign” elisp files.
packages
Config files for packages, config file for package abc is abc.el.
packages/inbuilt
Config files for inbuilt packages, with use-package set to :elpaca nil.

Archived

modeline.el
Should be named ”headerline.el”. Defines and propertize s functions that show information about the buffer, and display s them. Disables the mode-line and instead uses the header-line. Light-weight and inherits colors from the active theme. Replaced by modeline-simple.el.

Package Management

We use Elpaca to manage packages. It’s very easy to set up, and works well with native-compilation. The user does not need to intervene.

Inspired by Doom, this config uses separate module-like configuration files for every package. This is aided by a small custom function (elpacaLF) that creates a config file for a package when it is installed for the first time, and loads the file. The config is just a use-package block with :elpaca (if necessary).

Internal packages can also be configured. They use :elpaca nil .

If you don’t like the package, you can remove the corresponding elpacaLF invocation and the package will be completely ignored on the next startup / eval. Packages can also be installed by eval ing a new elpacaLF invocation.

All packages will be :pin ned shortly, to make this reproducible.

Vim Emulation

We use evil for Vim Emulation. As a Vim refugee, I’ve tried many times to get used to Emacs’ keybinds, but I keep going back to the simplicity of modal editing.

Keybinds

We use general.el for keybinds.

Additional modifiers used
Hyper. Use xmodmap to convert a key to Hyper.

Headerline

The Headerline is mostly just a propertized default modeline. It uses face-remapping-alist to change the face for the header-line depending on (buffer-modified-p). The name of the current buffer is relative to the project root (if found). We also cache the name of the current buffer (picked up from doom-modeline’s “light” variant). The active buffer also has two indicators on either extreme end.

Making it your own

As of [23-06-14 22:28:53] , this config is still a work in progress but ~90% to STABLE status. It lacks language-specific configuration and some ease-of-use modifications. Those will be added in time, but if you’re a former Doom Emacs user, you can use this config as a starting point.

What you need to do:

  • Clone to ~/.emacs.d. Alternatively, use Chemacs to enable multiple configs.
  • Search for ~/ and sys2 and remove / modify all local filesystem calls.

Update [23-09-06 18:07:21] : This project is about ~95% stable. There are no overt bugs or surprises, almost everything works well and with speed. Language support has been added, along with many small improvements. The emacs version has also been bumped, but no changes have been necessary.

Update [24-04-18 21:21:51] : This project is stable, but if you want to use it, you’ll have to weed out all the references to my local filesystem.

Screenshots

With the new modeline: .assets/screenshot5.jpg

.assets/screenshot6.jpg

.assets/screenshot7.jpg

Old

.assets/screenshot1.jpg

.assets/screenshot2.jpg

.assets/screenshot3.jpg

.assets/screenshot4.jpg

Releases

No releases published

Packages

No packages published