Finally, a simple base Emacs configuration framework
- KISS, clean configuration and a comprehensible layers system with minimal abstraction, (easy to hack on to make it “yours.”)
- Uses lightweight, mostly-vanilla configured layer packages
- Straight + use-package version version pinning for greater stability (pins are updated here approximately once a month.)
- Popular langs come with optional layers that are preconfigured with eglot LSP and company mode
- Interact with LLM’s using gptel
- Project Awareness is available with Projectile, and Magit
- Everything is deferred as much as is reasonable, for <1 second initial load times with all layers enabled
- Holy mode is default, while evil mode is available in the spartan-library
- Vertico minibuffer with fuzzy completion
- Tested on Linux, but should work also work fine anywhere for the most part.
- Tuned for ultimate performance using the latest gccemacs with native json parsing with eglot language server protocol (not required, just recommended.)
- Sat 23 Sep 2023 01:49:46 PM MDT - I have an eye towards tree-sitter, but have found setup and configuration incredibly complicated, and especially resulting in an inconsistent experience around something so basic as indentation, so we can wait a while longer for things to standardize and settle down before moving in that direction.
Spartan Emacs is not a starter kit. It does not teach Emacs. If you are new, and please begin by checking out
M-x help-with-tutorial
.M-x
means (Alt
+x
) and thenhelp-with-tutorial
Return (enter) to begin. One might follow up withAn Introduction to Programming in Emacs Lisp
additionally. The manuals may all be found at https://www.gnu.org/software/emacs/manual/
git clone https://github.com/a-schaefers/spartan-emacs.git ~/.emacs.d
Layers use pinned packages via Straight.el and are periodically updated.
- git pull
- M-x straight-thaw-versions
- Restart Emacs
- Edit
.emacs.d/spartan.el
to configure the theme, fonts, and additional language layers, then restart
- init.el (among other things) auto-generates a default ~/.emacs.d/spartan.el
This configuration file is not stored in our Git, but you might want to add it in to yours.
It may freely be modified by the user, but keep in mind it loads early, before the layers.
- Enabled layer packages are loaded after ~/.emacs.d/spartan.el
- Layer packages may be again customized in ~/.emacs.d/spartan.d/ with any additional setup or overrides
(all lisp files in spartan.d/ auto load last, during the after-init-hook)
The idea here is to provide everywhere the get up and going configuration, this means proper syntax support,
auto-completion and find definition, etc. via eglot’s minimal language server protocol implementation.
Some of the language modes also include repls. Debugging is provided within many of the languages themselves,
e.g. Python has pdb. With C, one may use M-x gdb
, etc.
With compiled languages, one might use M-x cc and set the compile-command to something instead of make if needed, etc.
To enable LSP for a language layer that supports it, note the external package you will need from below.
If the LSP executable is on your PATH and the language layer is active, then eglot
is going to automatically initialize it.
- Bash (shellcheck)
- C (clang and clangd)
Bash and C layers are provided OOTB. While dozens of other layers live in spartan-library/ and can be copied in to spartan.d/ to enable them.
- Default emacs binds (unless you enable evil.)
- Short M-x aliases
- M-x git (magit)
- M-x pro (projectile-commander)
- M-x sh (better-shell)
- M-x lint (flymake)
- M-x cc (compile-command)
- etc…
- Also see spartan-eglot.el for language-server-protocol binds under the M- prefix.
- Language mode specifc binds should be handled by the mode upstream or by the individual user.
- Overrides go in
.emacs.d/spartan.d/