Coder Social home page Coder Social logo

spartan-emacs's Introduction

SPARTAN EMACS

Finally, a simple base Emacs configuration framework

FEATURES

  • 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 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/

    spartan-theme.png

QUICK INSTALL

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

HOW TO UPDATE

Layers use pinned packages via Straight.el and are periodically updated.

  1. git pull
  2. M-x straight-thaw-versions
  3. Restart Emacs

LAYERS

  • Edit .emacs.d/spartan.el to configure the theme, fonts, and additional language layers, then restart

HOW LAYERS WORK

  1. 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.

  2. Enabled layer packages are loaded after ~/.emacs.d/spartan.el
  3. 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)

MINIMAL LANGUAGE LAYERS PRECONFIGURED

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.

BINDS

  • 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/

spartan-emacs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

spartan-emacs's Issues

Vetted packages arent native compiled automatically

For most of them, doesn't matter. Work around is to,

  1. open file
  2. M-x `emacs-lisp-native-compile-and-load'

I'd do this for s.el, amx, and ido-completing-read+

This should be fixed for all the libs in that directory to programatically to do this with something similar to,

    ;; native-compile all Elisp files under a directory
    (native-compile-async "/path/to/packages" 'recursively)

Security team + git submodule deps

Let's get away from elpa and melpa as much as possible, pull in all dependencies using git submodules, and audit updates together.

Who's with me?

[bug] after-init-hook and after-init

Put "after-init" configuration in ~/.emacs.d/spartan.d/ does not work. But put "after-init" configuration in spartan.el works.

eg:

(add-hook 'after-init-hook 'global-display-fill-column-indicator-mode)
(setq-default fill-column 80)

(use-package doom-modeline
  :straight t
  :defer t
  :config
  :hook (after-init . doom-modeline-mode))

Language Layers Wanted

I only mess with Bash and Python most of the time, so that's all there is.

Notice the Python layer doesn't have any dependencies other than eglot-- it includes debugging with pdb, a repl, a linter, intelligent auto completion, find definition, etc...

It only requires a user to do something like, pip install --user pipenv && pipenv install --user python-language-server[all] and they're done.

Eglot should make our language layers mostly batteries included!

Use as many Emacs builtins + Eglot (LSP) features as possible. That's the ideal.

Flymake needs testing on the all the new languages

The lsp servers should be working for all the new language supports I added, but I haven't tested flymake. Sometimes flymake needs an additional backends package. Sometimes it doesn't Flymake is weird.

Readme Rewrite

If anyone wants to take on the readme.org file and make it more professional that'd be great.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.