drshapeless / .emacs.d

my emacs setup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

drshapeless emacs configuration

This Emacs configuration is for Linux and macOS. I have never use Emacs on Windows, (in fact I have not been using Windows for a long time).

The structure of this config is heavily influenced by Steve Purcell, https://github.com/purcell/emacs.d, but the context is completely built from scratch.

I am not a programmer. My profession is a Traditional Chinese Medicine practitioner. (This is a legal profession in Hong Kong, and I work in clinics to provide medical treatments.)

I have been using Emacs since 2020, and actively update my configuration.

Emacs version

I used to live in HEAD, compile Emacs from source every month. Now I use Gentoo and just update occasionally.

On macOS, I used to go with emacs-mac by YAMAMOTO Mitsuharu, which is only up to the latest stable build. Now I use emacs-plus, because I want to try the newest features in the master.

I wrote a blog about how I build Emacs on different platforms.

Key bindings

I use the classic Emacs key bindings. I have never use vim before, no reason for me to use evil.

Features of this configuration

I think use-package hides a lot of details of how the underlying elisp works by the excessive amount of keywords. It is not an issue for an elisp expert, but if you are a beginner, you may face a lot of difficulties of how to write you own config from scratch.

Although use-package is very popular, I actually recommend its alternative, leaf, which is very similar to use-package, but cleaner and more predictable, (use-package may have fixed some of the issues that leaf want to fix in the first place, but I haven’t been using either of them in a while).

I use pure elisp without macros for most of the configurations. This may seems an alien act to modern Emacs users.

I used to use straight.el to manage my config. It is slow, single-threaded. Merging packages will lead to blocking the whole Emacs, which is not ideal. Elpaca on the other hand, fixes all the issues of straight.el. I was not adapting to it because I was using EXWM back in the days, and I didn’t know how to use Elpaca to initialize EXWM asynchronously. (Now, I know, but I no longer use EXWM, instead I am using sway and the pgtk build of Emacs.)

Custom theme

I wrote my own theme from scratch because I want a dark theme with lower contract to protect my eyes. However, the theme I wrote is far from polished, therefore I never make a package for it.

Picks packages that utilize internal Emacs functions

There are some very popular packages like ivy, company, lsp-mode, mu4e. But for historical reasons, most of them develop a set of specified functions for their own use. In the development of Emacs, a lot of things have been added to the core, newer packages can then utilize internal Emacs functions to do things.

However, packages like ivy and company have been doing things in their own way for a long time, their size are likely bloated because they contains some duplicated specified functions. So packages like corfu, which is an alternative to company, are much lighter and less error prone. (corfu is not a complete replacement for company, but to me, it does everything I need.)

This config would choose packages that prefers built-in functions.

No org-babel

A lot of Emacs users are leaning towards using a single org file to manage their Emacs config, for the purpose of literate programming. I personally think literate programming is a good idea, but it is not suitable for Emacs config. Not everything needs explaination, good code tells what it does and why it is. A lot of time, I ended up with a single code block without any comments. The problem of using org file for config is that, you need to export it to elisp every time. Although you can add to hook to save-file, it is a bit stupid to export your whole config for fixing a typo.

As a result, I choose to use the Purcell’s way to separate config into small files.

Packages of choice

These are some of my many packages that worth to mention.

  • eglot (lsp, built-in since version 29)
  • treesit (tree-sitter support, built-in since version 29)
  • corfu (completion)
  • cape (extra completion-at-point-functions)
  • vertico (ivy replacement)
  • marginalia (extra info)
  • consult (better alternatives for build in functions)
  • yasnippet (snippet, now exclusively for eglot)
  • tempel (snippet, major one)
  • vterm (terminal)
  • notmuch (email)
  • nov (epub)
  • moodline (custom modeline)
  • multiple-cursors
  • org-roam

Theme

I use my custom shapeless-theme, which is an extremely dark theme with low contrast.

Fun fact

I did not even know how to program nor do I have any necessary use when I start using Emacs. The only reason why I downloaded Emacs was because I was an Apple fanboy, and stupid enough to think Emacs has something related to macOS…

Causions

There are a lot of weird functions in my config, mostly only suitable for my personal use. The majority of them live in init-helpers.el.

I recommend not to use my config directly, if you are interested, just copy whatever lines you want.

About

my emacs setup

License:GNU General Public License v3.0


Languages

Language:Emacs Lisp 98.4%Language:YASnippet 1.6%