This is my personal, “slightly configured” Emacs.
There are some packages written by me for my own convenience. See the last section.
This configuration supports macOS, and Linux. It should work on Windows for the most part.
The following Emacs versions are explicitly supported. NOTE: the Emacs version shipped in the current Debian stable (since 13 “trixie”) will be supported.
Version | Notes |
---|---|
29 | the current stable version; will be shipped in Debian 13 |
30 | the current “testing” version |
31 | the current development version |
There are two kinds of configuration, Module and Volatile. The distinction is (in my mind) very successful.
Modules make up the functionality and keybindings. They are stable and can be byte compiled safely and cleanly. Ideally, they use lexical scoping.
Volatile configuration files are more fragile and personal. They are mainly temporary tests or (let’s hope not) ugly hacks. A volatile Lisp file should never be byte compiled. Typically, it’s dynamically scoped.
The following fonts are “blessed” in this configuration.
Font | Point | Usage |
---|---|---|
(Any monospace font) | 14 | General use (non-Chinese) |
Sarasa Mono | 14 | For perfect Chinese alignment |
These modifications are generally in prelude-core.el
and
prelude-ui.el
, and a few other files. They are loaded before anything
else.
Prominent user-visible modifications are listed below.
Any of the following looks pretty good:
- Default
- Doom mode line
- Moody
I’m not fully invested in Evil, so currently it can be disabled
completely by commenting out (require 'prelude-evil)
in init.el
.
I use Evil, because the Vi-style editing commands are the de facto standard right now, and evil-collection is great, and I still retain some muscle memory (I used to be a Vim user). Though, conceptually, I like Meow better.
Evil-collection offers a large collection of consistent, pre-configured keybindings for a variety of major modes. See its readme.
I use a hybrid editing style, i.e. in the insert mode, most Emacs
commands are still available, so I can keep my muscle memory as much
as possible. This is done by customizing
evil-disable-insert-state-bindings
. The conflicts are resolved
depending on which is most familiar to me.
I use Vertico, Prescient, and Orderless.
Vertico offers a lightweight yet versatile frontend to
completion-at-point
.
Orderless significantly enhances the default completion algorithms, though its sorting is less than ideal.
Many temporary buffers pop up in the side windows.
C-TAB
toggles whether or not side windows are displayed.
C-SPC C-SPC
to expand the current region meaningfully. It supports
tree-sitter-based expansion.
M-z
was assigned to zap-up-to-char
. You can easily achieve what
zap-to-char
does with M-z <char> C-d
.
At first, I thought M-z t
and M-z f
would be cool, but it turned
out to be a horrible idea, because one must stop to think which key to
press.
Structured editing operates on the level of syntactical structures, be it identifiers, expressions, or statements.
I use paredit for the Lisp family. For tree-sitter-powered major modes, use combobulate-mode.
I’ve fully embraced LSP! (Used to be a skeptic.)
eglot
as the LSP client. (Easier to hack thanlsp-mode
.)corfu
as the universal completion frontend.
Language servers can be installed via Homebrew or Nix. Eglot is intelligent enough to work with any server without special configuration.
Many major modes support REPL, but their keybindings are often very different. The following keychords are adopted by Emacs itself, so they are preferred when possible.
Key | Function |
---|---|
C-c C-c | Send buffer |
C-c C-l | Send file |
C-x C-e | Send this expression |
C-M-x | Send this function |
Haskell-mode has Interactive Haskell mode supporting ghci. Due to
Haskell’s specialness, all you can do is C-c C-l
.
Elpy defined a bunch of send functions, but they turn out to be not so helpful.
Coq is an interactive proof assistant, whose Emacs interface is Proof General, which defines its own set of commands.
This repo hosts some other Emacs Lisp works made by me for my own convenience. It might be useful for you, too, so I made a list here for better discoverability.
Who | Where | What |
---|---|---|
pest-mode | github ksqsf/pest-mode | Major mode for Pest files |
treefold | ./lisp/treefold.el | Fold any tree-like text |
smtlib2-mode | ./lisp/smtlib2-mode.el | Major mode for SMT scripts |
lojban | ./lisp/lojban.el | Zbalermorna input and rendering |
bionic-reading | ./lisp/bionic-reading.el | A (sort of) bionic reader in Emacs |
clipboard | ./lisp/clipboard.el | clipboard inspector |
clipmgr | ./lisp/clipmgr.el | (WIP) a clipboard manager |
region-mark | ./lisp/region-mark.el | |
fish-protector | ./lisp/fish-protector.el | 魚の護衛者 |
logseq | ./lisp/logseq.el | Logseq HTTP API |
leitner | ./lisp/leitner.el | The Leitner system (a kind of SRS) |
org-xlatex | github ksqsf/org-xlatex | instant latex preview |
flygpt | ./lisp/flygpt.el | semantic flymake based on GPT |