Skip to content

Finally, a simple base Emacs configuration framework

License

Notifications You must be signed in to change notification settings

digitive/spartan-emacs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPARTAN EMACS

Finally, a simple base Emacs configuration framework

spartan-theme.png

A word for beginners:

Spartan Emacs is a framework, not a starter kit. It does not teach Emacs. If you are new, welcome, and please begin by checking out `M-x help-with-tutorial`. `M-x` means meta (‘alt’) + `x` and then `help-with-tutorial` Return (enter) to begin. One might follow up with `An Introduction to Programming in Emacs Lisp` additionally. The manuals may all be found at https://www.gnu.org/software/emacs/manual/

QUICK INSTALL

git clone https://github.com/grandfoobah/spartan-emacs.git ~/.emacs.d

FEATURES

  • KISS, clean configuration and a comprehensible layers system
  • No third party packages install by default - prefers built-ins
  • Uses lightweight, mostly-vanilla configured layer packages
  • Popular langs come with optional layers that are preconfigured with the best modes, a REPL, and intelligent LSP auto-completion, find def, etc. via Eglot
  • Project Awareness is available with Projectile, VC with Magit
  • Support for Evil mode with spartan-evil layer
  • Load time with all layers enabled is less than 1 second on a 10 year old laptop - without resorting to use-package, deferrals, pdumper or hacks.
  • Tested on Linux, but should work also work fine on any gnu/bsd/macos base
  • Tuned for ultimate performance using the latest pgtk gccemacs with native json parsing with eglot language server protocol (not required, just recommended)
  • No syntax highlighting

LAYERS

  • Edit init.el and M-x spartan-reconfigure

HOW LAYERS WORK

  • Enabled layer packages are installed during init
  • Then layer packages are configured in the after-init-hook
  • Finally layer packages may be user local customized in spartan.d/

    (all lisp files in spartan.d/ load last, during the emacs-startup-hook)

MINIMAL LANGUAGE LAYERS PRECONFIGURED

NOTE: The idea here is to provde everywhere the get up and going configuration, this means proper syntax formatting with an interactive repl for rapid development, and intelligent auto-completion and find definition, etc. via eglot’s minimal language server protocol implementation.

Debugging is provided within many of the languages itself, e.g. Python and Ruby have builtin debuggers. With C, one may use M-x `gdb’ with ‘gdb’, etc.

With compiled languages, one might use <f5> and set the compile command to something instead of make if needed, etc.

  • Emacs Lisp (paredit, builtins)
  • Common Lisp (paredit, slime)
  • C / C++ (lsp)
  • Clojure, Clojurescript (paredit, lsp, inf-clojure)
  • Racket (paredit)
  • Scheme (paredit)
  • Bash (shellcheck, lsp)
  • Python (lsp)
  • Ruby (lsp)
  • Rust (lsp)
  • Solidity (lsp)
  • Go (lsp)
  • Javascript / Typescript (lsp)
  • Extra cfg file formatting / syntax support: Terraform, Nix, Systemd, Nginx, JSON, YAML, XML

HOW TO HACK

  • Fork repo, clone it, own it

HOW TO UPDATE

  • git pull
  • M-x package-list-packages => U => x

BINDS

  • Default emacs binds (unless you enable evil)
  • Principally, we want to use short M-x aliases, while also putting global function binds on C-c and language specific binds on M-m prefixes
  • Do look at spartan-binds-global.el to get the general idea,

    M-x ff (find files) , M-x rg (rgrep files) , M-x kr (browse-kill-ring) , M-x ed (ediff) , M-x git (magit) , M-x lint (flymake) , M-x pb (webpaste) , M-x sh (better-shell) , <f5> (compile) , <f6> (script execute) …

  • Also see spartan-eglot.el for language-server-protocol binds
  • And for language-specific files, see relevant language file e.g. spartan-python.el

CONTRIBUTE

Tips for MacOS users

brew install coreutils findutils gnu-tar gnu-sed gawk gnutls gnu-indent gnu-getopt grep bash
echo '/opt/homebrew/bin/bash' | sudo tee -a /etc/shells
chsh -s /opt/homebrew/bin/bash

Automatically “Linuxify’s” your Emacs environent https://github.com/a-schaefers/spartan-emacs/commit/0ba55e7580ca70f9ef172a5464bba8bd575df7b8

About

Finally, a simple base Emacs configuration framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 100.0%