This repository contains my configuration for GNU Emacs.
It is intended to be used only by me, not by other people. Anyway, here are the main features of my config.
- No Org-mode for emacs config because good old
.elfiles are much more convenient for me. - Unusable key bindings: I use hundreds and hundreds of non-standard key bindings that are suitable for me. Besides, I use dvorak layout, so my bindings may look really weird for other people. I use my code (from keys.el) based on bind-key to manage those tons of keys.
- I prefer to split my config into multiple files instead of keeping
everything in a single one. And it is really easy to search them
using imenus. I just press
s-s(which is bound toal/imenus-search-elisp-dirfrom al-imenus.el) and jump towith-eval-after-loadclause or performisearchoroccurif I need to search for something. - I use an insane mix of quelpa/melpa/GNU Guix to install/upgrade Emacs packages. Do not try this at home ☺.
- My Emacs config is intended to be robust. I mean it does not require any third-party packages to be started successfully. So I can easily deploy my config on a fresh system: I just clone the repo and make ~/.emacs.d/init.el file a symlink to my init.el. Actually, this process is even more simple, as I don’t do this manually — I use my config script to fetch and deploy all my configs including this Emacs config.
- And I don’t use use-package anymore (see commit 2e49f03). I used to
do it until I realized the importance of the previous point. When you
use
use-packagein your config, it becomes a required dependency for starting Emacs, so on a “fresh” system, you need to install it at first, before you can use your config. Also someday it may be changed in a way that will break your system, and you’ll have to fix your config without using it.Update:
use-packageis shipped with Emacs nowadays but I don’t see any benefits to use it again. - My Emacs start time is always less than a second according to
M-x emacs-init-time(actually, I have this value in myinitial-scratch-messageso I know the init time very well), because:- I use some hacks to reduce startup time in my early-init.el.
- I don’t
requirepackages without a reason as some people do. Instead, I usewith-eval-after-loadeverywhere. - I don’t load
…-autoloads.elfiles for every installed package (Emacs does it by default). I disable this autoloading by settingpackage-enable-at-startupto nil in early-init.el. Instead, I generate and load only a couple of autoloads:- one file for all Emacs packages (installed from MELPA, etc.),
- one file for my utils,
- one file for my packages.
Search for
al/generate-autoloadsat al-autoload.el and init.el to see how autoloads are generated. I also use al/generate-autoloads-from-presets command to quickly update these autoloads when I need.
As you can see, this repository consists of the following directories:
- init: files that are loaded on Emacs start. As described above, init.el is the “main” init file. It defines some major things and loads the rest files from this directory.
- utils: various utilities and additional code (for Emacs itself and for
external packages) that is not needed for start-up. All of the code
here has
al/prefix and is placed in files that provideal-…features. My init files are full of things like this:(with-eval-after-load 'eshell ;; ... (when (require 'al-eshell nil t) ;; ... ))
So these utils are loaded only if and when they are needed. Also there are many interactive commands there which are autoloaded.
In the past these utils were placed in a separate repository and had “utl-” prefix.
- packages: small packages that do not deserve their own repositories. I also clone all my “big” packages to this directory (they are ignored by .gitignore).
- unused: files with old and unused code.
- data: just some Emacs related data (like eshell aliases, auto save and backup files, gnus archive, elpa packages, etc.).