Skip to content

jasalt/.emacs.d

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Personal work-in-progress Emacs 29+ IDE setup aimed to be on par and exceed NeoVim and VSCode in computer keyboard activities. Mainly focused in coding PHP, Clojure and Python and org-mode.

This is not a stable project for broad public consumption at this point. Upstream Bedrock project, Prelude or some other config distribution is probably a better starting point for a new config for most people. There may be some useful config snippets however.

Supported IDE features by language

LanguageLSPDAPTree-sitterTS “auto build”
PHPxxx*
Pythonxx**x
Clojurex***x
Yamlxxx
  • * PHP tree-sitter needs to be improved to support embedded HTML and PHP eg. mixed documents. Related pull request nvim-treesitter/nvim-treesitter#5876 issue which has been updated since I looked at it the last time.
  • ** Python DAP is enabled but not tested
  • *** Clojure uses Cider which provides step debugger

Background

Previously I have been coding mostly with VSCode for work and fun instead of Emacs where it used to seem too time consuming to support different programming languages with various 3rd party packages for syntax coloring, indendation, code intelligence, debugging tools and so on. Situation however changed last few years with tree-sitter, LSP and DAP projects where those features are being developed in standard editor-agnostic way and can be used and configured in more generic way on editor side.

Details

This is based on my earlier Emacs Prelude based config (2013-) that was mostly in use for simple scripting, magit and note taking that was migrated 2023 over to more minimal Bedrock starter config. It is currently kept up to date with Bedrock upstream development on relevant parts while deviates a bit with few overrides in Bedrock config.

On original Bedrock config side, there are two files of interest: early-init.el and init.el. Follow original repo readme for more info. Package management is handled using standard use-package (and straight for git support) which embeds configuration for each package in a neat way.

Own additions are in personal/ directory while changes in other files are kept minimal.

  • Includes many best parts of Emacs Prelude via crux.el in personal/custom.el and programming config in personal/programming.el.
  • Multiple cursors
  • Keychords
  • Org-mode “GTD” setup
  • Etc.

Installation

Install Emacs 29+, from eg. Debian 12 Backports repo or d12frosted/homebrew-emacs-plus on Mac. Clone this repository as .emacs.d and install tree-sitter grammars before start.

Also, Emacs 29.1 added the handy --init-directory flag. This means that you can run emacs --init-directory path/to/emacs-bedrock/ and all the customizations and package installations will be isolated to the project directory.

There may be some problems to diagnose after install, this is not a stable project after all.

Installing tree-sitter grammars

Currently tree-sitter grammars need to be placed at ~/.emacs.d/tree-sitter/ before start. Automatic installation method is work in progress.

To install them manually:

“` git clone https://github.com/casouri/tree-sitter-module.git cd tree-sitter-module ./batch mkdir ~/.emacs.d/tree-sitter mv dist/* ~/.emacs.d/tree-sitter

“`

Ref: https://git.savannah.gnu.org/cgit/emacs.git/tree/admin/notes/tree-sitter/starter-guide?h=feature/tree-sitter

PHP tree-sitter mode is more in progress and is built individually:

“` git clone https://github.com/tree-sitter/tree-sitter-php.git cd tree-sitter-php make ln -s `pwd`/libtree-sitter-php.so ~/.emacs.d/tree-sitter “`

LSP

Config uses lsp-mode over (built-in) eglot which installs LSP servers automatically for languages enabled in config (hook (lsp)).

I found the built-in eglot LSP client being bit overwhelming to get working over lsp-mode that has more IDE features built-in like DAP debugging and automatic LSP server installation. It is also quite well documented in one place, plus also in video format on System Crafters Youtube channel.

Performance-wise it seems also fine for debugging eg. a large web-app, like a full WordPress-installation with near 5000 files to watch on Skylake-era laptop CPU, comparing to experience with NeoVim (or VSCode), for now at least.

Copilot

M-x copilot-login

About

Emacs 29+ setup which is a mix of Emacs Bedrock and Emacs Prelude.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 100.0%