feat: add vanilla emacs e7882cfe
Steve · 2026-10-07 22:04 8 file(s) · +404 −0
emacs/early-init.el (added) +19 −0
1 +
;;; early-init.el -*- lexical-binding: t; -*-
2 +
3 +
;; Faster startup: defer GC, restore after init
4 +
(setq gc-cons-threshold most-positive-fixnum)
5 +
(add-hook 'emacs-startup-hook
6 +
          (lambda () (setq gc-cons-threshold (* 16 1024 1024))))
7 +
8 +
;; Skip UI chrome before first frame draws
9 +
(setq package-enable-at-startup t
10 +
      inhibit-startup-screen t
11 +
      frame-inhibit-implied-resize t)
12 +
(push '(menu-bar-lines . 0) default-frame-alist)
13 +
(push '(tool-bar-lines . 0) default-frame-alist)
14 +
(push '(vertical-scroll-bars) default-frame-alist)
15 +
(push '(background-color . "#121113") default-frame-alist)
16 +
(push '(foreground-color . "#c1c1c1") default-frame-alist)
17 +
18 +
;; Keep native-comp noise quiet
19 +
(setq native-comp-async-report-warnings-errors 'silent)
emacs/init.el (added) +24 −0
1 +
;;; init.el -*- lexical-binding: t; -*-
2 +
3 +
(defvar my/cache-dir (expand-file-name "emacs/" "~/.cache/")
4 +
  "Where state, backups and custom settings live (outside the dotfiles repo).")
5 +
(make-directory my/cache-dir t)
6 +
7 +
(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory))
8 +
(add-to-list 'custom-theme-load-path (expand-file-name "themes" user-emacs-directory))
9 +
(setq custom-file (expand-file-name "custom.el" my/cache-dir))
10 +
(load custom-file 'noerror 'nomessage)
11 +
12 +
;;; Packages
13 +
(require 'package)
14 +
(setq package-archives '(("gnu"    . "https://elpa.gnu.org/packages/")
15 +
                         ("nongnu" . "https://elpa.nongnu.org/nongnu/")
16 +
                         ("melpa"  . "https://melpa.org/packages/")))
17 +
(unless package-archive-contents (package-refresh-contents))
18 +
(setq use-package-always-ensure t)
19 +
20 +
(require 'init-defaults)
21 +
(require 'init-evil)
22 +
(require 'init-ui)
23 +
(require 'init-erc)
24 +
(require 'init-tools)
emacs/lisp/init-defaults.el (added) +82 −0
1 +
;;; init-defaults.el -*- lexical-binding: t; -*-
2 +
3 +
(setq user-full-name "Steve Simkins")
4 +
5 +
;; Backups, autosaves, lockfiles: keep out of project dirs
6 +
(let ((dir (expand-file-name "backups/" my/cache-dir)))
7 +
  (make-directory dir t)
8 +
  (setq backup-directory-alist `(("." . ,dir))
9 +
        auto-save-file-name-transforms `((".*" ,dir t))
10 +
        create-lockfiles nil
11 +
        backup-by-copying t
12 +
        delete-old-versions t
13 +
        version-control t))
14 +
15 +
(setq save-place-file (expand-file-name "places" my/cache-dir)
16 +
      savehist-file (expand-file-name "history" my/cache-dir)
17 +
      recentf-save-file (expand-file-name "recentf" my/cache-dir)
18 +
      recentf-max-saved-items 200)
19 +
20 +
;; Sane editing
21 +
(setq-default indent-tabs-mode nil
22 +
              tab-width 4
23 +
              fill-column 80)
24 +
(setq sentence-end-double-space nil
25 +
      require-final-newline t
26 +
      ring-bell-function #'ignore
27 +
      use-short-answers t
28 +
      confirm-kill-emacs #'y-or-n-p
29 +
      scroll-conservatively 101
30 +
      scroll-margin 3
31 +
      mouse-wheel-progressive-speed nil
32 +
      load-prefer-newer t
33 +
      read-process-output-max (* 1024 1024))
34 +
35 +
;; Built-in minor modes worth having
36 +
(delete-selection-mode 1)
37 +
(electric-pair-mode 1)
38 +
(show-paren-mode 1)
39 +
(save-place-mode 1)
40 +
(savehist-mode 1)
41 +
(recentf-mode 1)
42 +
(global-auto-revert-mode 1)
43 +
(setq global-auto-revert-non-file-buffers t)
44 +
(global-so-long-mode 1)
45 +
(repeat-mode 1)
46 +
(column-number-mode 1)
47 +
(pixel-scroll-precision-mode 1)
48 +
49 +
;; Completion (built-in, no packages)
50 +
(setq completion-styles '(basic partial-completion flex)
51 +
      completions-detailed t
52 +
      completion-auto-help 'visible
53 +
      completion-auto-select 'second-tab
54 +
      tab-always-indent 'complete
55 +
      read-file-name-completion-ignore-case t
56 +
      read-buffer-completion-ignore-case t)
57 +
(fido-vertical-mode 1)
58 +
59 +
;; Line numbers in code/text, relative like Doom config
60 +
(setq display-line-numbers-type 'relative)
61 +
(add-hook 'prog-mode-hook #'display-line-numbers-mode)
62 +
(add-hook 'text-mode-hook #'display-line-numbers-mode)
63 +
64 +
;; Trim trailing whitespace on save
65 +
(add-hook 'before-save-hook #'delete-trailing-whitespace)
66 +
67 +
;; macOS
68 +
(when (eq system-type 'darwin)
69 +
  (setq mac-command-modifier 'super
70 +
        mac-option-modifier 'meta
71 +
        ns-use-proxy-icon nil))
72 +
73 +
;; GUI emacs: pick up shell PATH (brew, pass, gpg)
74 +
(use-package exec-path-from-shell
75 +
  :if (memq window-system '(mac ns))
76 +
  :config (exec-path-from-shell-initialize))
77 +
78 +
(use-package which-key
79 +
  :ensure nil
80 +
  :init (which-key-mode 1))
81 +
82 +
(provide 'init-defaults)
emacs/lisp/init-erc.el (added) +42 −0
1 +
;;; init-erc.el -*- lexical-binding: t; -*-
2 +
3 +
(require 'auth-source-pass)
4 +
5 +
;; soju password: read from `pass' (gpg-encrypted), cached in memory per session
6 +
(defvar my/soju-pass-entry "irc/soju")
7 +
(defvar my/soju--password nil)
8 +
9 +
(defun my/soju-password (&rest _)
10 +
  (or my/soju--password
11 +
      (setq my/soju--password
12 +
            (or (auth-source-pass-get 'secret my/soju-pass-entry)
13 +
                (user-error "No soju password in pass entry %s" my/soju-pass-entry)))))
14 +
15 +
(defun my/soju-user (client &optional network)
16 +
  "Build soju username for CLIENT on NETWORK (default libera)."
17 +
  (format "stevedylandev_/%s@%s" (or network "libera") client))
18 +
19 +
(with-eval-after-load 'erc
20 +
  (setq erc-server "138.197.115.89"
21 +
        erc-port 6697
22 +
        erc-nick "stevedylandev_"
23 +
        erc-user-full-name "Steve Simkins"
24 +
        erc-prompt-for-password nil
25 +
        erc-track-shorten-start 8
26 +
        erc-kill-buffer-on-part t
27 +
        erc-kill-queries-on-quit t
28 +
        erc-hide-list '("JOIN" "PART" "QUIT")
29 +
        erc-nicks-skip-nicks '("ChanServ" "NickServ"))
30 +
  (add-to-list 'erc-modules 'nicks)
31 +
  (erc-update-modules))
32 +
33 +
(defun my/erc-soju ()
34 +
  "Connect ERC to soju over TLS."
35 +
  (interactive)
36 +
  (erc-tls :server "138.197.115.89"
37 +
           :port 6697
38 +
           :nick "stevedylandev_"
39 +
           :user (my/soju-user "erc")
40 +
           :password (my/soju-password)))
41 +
42 +
(provide 'init-erc)
emacs/lisp/init-evil.el (added) +91 −0
1 +
;;; init-evil.el -*- lexical-binding: t; -*-
2 +
3 +
(use-package evil
4 +
  :init
5 +
  (setq evil-want-integration t
6 +
        evil-want-keybinding nil   ; evil-collection handles other modes
7 +
        evil-want-C-u-scroll t
8 +
        evil-want-Y-yank-to-eol t
9 +
        evil-undo-system 'undo-redo
10 +
        evil-split-window-below t
11 +
        evil-vsplit-window-right t)
12 +
  :config
13 +
  (evil-mode 1))
14 +
15 +
(use-package evil-collection
16 +
  :after evil
17 +
  :config
18 +
  (evil-collection-init))
19 +
20 +
(use-package general
21 +
  :after evil
22 +
  :config
23 +
  (general-create-definer my/leader
24 +
    :states '(normal visual motion insert emacs)
25 +
    :keymaps 'override
26 +
    :prefix "SPC"
27 +
    :global-prefix "M-SPC")
28 +
29 +
  (my/leader
30 +
    "SPC" '(project-find-file :wk "project file")
31 +
    ":"   '(execute-extended-command :wk "M-x")
32 +
    "."   '(find-file :wk "find file")
33 +
    ","   '(switch-to-buffer :wk "switch buffer")
34 +
    "/"   '(project-find-regexp :wk "project grep")
35 +
36 +
    "b"   '(:ignore t :wk "buffer")
37 +
    "bb"  '(switch-to-buffer :wk "switch")
38 +
    "bi"  '(ibuffer :wk "ibuffer")
39 +
    "bk"  '(kill-current-buffer :wk "kill")
40 +
    "bn"  '(next-buffer :wk "next")
41 +
    "bp"  '(previous-buffer :wk "previous")
42 +
    "bs"  '(save-buffer :wk "save")
43 +
44 +
    "f"   '(:ignore t :wk "file")
45 +
    "ff"  '(find-file :wk "find")
46 +
    "fr"  '(recentf-open :wk "recent")
47 +
    "fs"  '(save-buffer :wk "save")
48 +
    "fd"  '(dired-jump :wk "dired")
49 +
50 +
    "g"   '(:ignore t :wk "git")
51 +
    "gg"  '(magit-status :wk "status")
52 +
    "gb"  '(magit-blame :wk "blame")
53 +
    "gl"  '(magit-log-current :wk "log")
54 +
55 +
    "o"   '(:ignore t :wk "open")
56 +
    "oe"  '(elfeed :wk "elfeed")
57 +
    "oi"  '(my/erc-soju :wk "irc")
58 +
    "ot"  '(eshell :wk "eshell")
59 +
60 +
    "p"   '(:ignore t :wk "project")
61 +
    "pp"  '(project-switch-project :wk "switch")
62 +
    "pf"  '(project-find-file :wk "find file")
63 +
    "pg"  '(project-find-regexp :wk "grep")
64 +
    "pb"  '(project-switch-to-buffer :wk "buffer")
65 +
66 +
    "s"   '(:ignore t :wk "search")
67 +
    "ss"  '(isearch-forward :wk "isearch")
68 +
    "so"  '(occur :wk "occur")
69 +
70 +
    "w"   '(:ignore t :wk "window")
71 +
    "ww"  '(other-window :wk "other")
72 +
    "wv"  '(evil-window-vsplit :wk "vsplit")
73 +
    "ws"  '(evil-window-split :wk "split")
74 +
    "wd"  '(delete-window :wk "close")
75 +
    "wo"  '(delete-other-windows :wk "only")
76 +
    "wh"  '(evil-window-left :wk "left")
77 +
    "wj"  '(evil-window-down :wk "down")
78 +
    "wk"  '(evil-window-up :wk "up")
79 +
    "wl"  '(evil-window-right :wk "right")
80 +
    "w="  '(balance-windows :wk "balance")
81 +
82 +
    "h"   '(:ignore t :wk "help")
83 +
    "hf"  '(describe-function :wk "function")
84 +
    "hv"  '(describe-variable :wk "variable")
85 +
    "hk"  '(describe-key :wk "key")
86 +
    "hm"  '(describe-mode :wk "mode")
87 +
88 +
    "q"   '(:ignore t :wk "quit")
89 +
    "qq"  '(save-buffers-kill-terminal :wk "quit emacs")))
90 +
91 +
(provide 'init-evil)
emacs/lisp/init-tools.el (added) +16 −0
1 +
;;; init-tools.el -*- lexical-binding: t; -*-
2 +
3 +
(use-package magit
4 +
  :bind ("C-x g" . magit-status))
5 +
6 +
(use-package elfeed
7 +
  :bind ("C-x w" . elfeed))
8 +
9 +
;; Feeds live in ~/org/elfeed.org, same as the Doom setup
10 +
(use-package elfeed-org
11 +
  :after elfeed
12 +
  :config
13 +
  (setq rmh-elfeed-org-files (list "~/org/elfeed.org"))
14 +
  (elfeed-org))
15 +
16 +
(provide 'init-tools)
emacs/lisp/init-ui.el (added) +8 −0
1 +
;;; init-ui.el -*- lexical-binding: t; -*-
2 +
3 +
(when (display-graphic-p)
4 +
  (set-face-attribute 'default nil :family "BerkeleyMono Nerd Font" :height 140))
5 +
6 +
(load-theme 'darkmatter t)
7 +
8 +
(provide 'init-ui)
emacs/themes/darkmatter-theme.el (added) +122 −0
1 +
;;; darkmatter-theme.el --- Darkmatter -*- lexical-binding: t; -*-
2 +
3 +
;; Standalone port of the doom-darkmatter theme (no doom-themes needed).
4 +
;; https://darkmattertheme.com
5 +
6 +
(deftheme darkmatter "Darkmatter, based on Black Metal Bathory.")
7 +
8 +
(let* ((bg      "#121113")
9 +
       (base0   "#0b0a0b")
10 +
       (base2   "#1a191a")
11 +
       (base3   "#222222")
12 +
       (base4   "#333333")
13 +
       (base5   "#555555")
14 +
       (base6   "#777777")
15 +
       (base7   "#999999")
16 +
       (fg      "#c1c1c1")
17 +
       (fg-alt  "#999999")
18 +
       (red     "#aa6c6c")
19 +
       (orange  "#e78a53")
20 +
       (string  "#fbcb97")
21 +
       (teal    "#5f8787")
22 +
       (blue    "#888888")
23 +
       (violet  "#aaaaaa"))
24 +
  (custom-theme-set-faces
25 +
   'darkmatter
26 +
   `(default ((t (:background ,bg :foreground ,fg))))
27 +
   `(cursor ((t (:background ,orange))))
28 +
   `(fringe ((t (:background ,bg :foreground ,base4))))
29 +
   `(region ((t (:background ,base3 :extend t))))
30 +
   `(highlight ((t (:background ,base3))))
31 +
   `(hl-line ((t (:background ,base2))))
32 +
   `(secondary-selection ((t (:background ,base3))))
33 +
   `(shadow ((t (:foreground ,base6))))
34 +
   `(link ((t (:foreground ,orange :underline t))))
35 +
   `(link-visited ((t (:foreground ,base7 :underline t))))
36 +
   `(match ((t (:foreground ,orange :weight bold))))
37 +
   `(isearch ((t (:background ,orange :foreground ,bg :weight bold))))
38 +
   `(lazy-highlight ((t (:background ,base4 :foreground ,fg))))
39 +
   `(error ((t (:foreground ,red))))
40 +
   `(warning ((t (:foreground ,orange))))
41 +
   `(success ((t (:foreground ,string))))
42 +
   `(escape-glyph ((t (:foreground ,orange))))
43 +
   `(minibuffer-prompt ((t (:foreground ,orange))))
44 +
   `(vertical-border ((t (:foreground ,base3))))
45 +
   `(window-divider ((t (:foreground ,base3))))
46 +
   `(show-paren-match ((t (:foreground ,orange :weight bold :underline t))))
47 +
   `(show-paren-mismatch ((t (:background ,red :foreground ,bg))))
48 +
   `(trailing-whitespace ((t (:background ,base4))))
49 +
50 +
   ;; line numbers
51 +
   `(line-number ((t (:foreground ,base4 :background ,bg))))
52 +
   `(line-number-current-line ((t (:foreground ,orange :background ,bg))))
53 +
54 +
   ;; mode line
55 +
   `(mode-line ((t (:background ,bg :foreground ,fg :box nil :overline ,base3))))
56 +
   `(mode-line-inactive ((t (:background ,bg :foreground ,base6 :box nil :overline ,base3))))
57 +
   `(mode-line-emphasis ((t (:foreground ,orange))))
58 +
   `(mode-line-buffer-id ((t (:weight bold))))
59 +
   `(header-line ((t (:background ,bg :foreground ,fg-alt))))
60 +
61 +
   ;; syntax
62 +
   `(font-lock-builtin-face ((t (:foreground ,base7))))
63 +
   `(font-lock-comment-face ((t (:foreground ,base5))))
64 +
   `(font-lock-comment-delimiter-face ((t (:foreground ,base5))))
65 +
   `(font-lock-doc-face ((t (:foreground ,base6))))
66 +
   `(font-lock-constant-face ((t (:foreground ,violet))))
67 +
   `(font-lock-function-name-face ((t (:foreground ,blue))))
68 +
   `(font-lock-keyword-face ((t (:foreground ,base7))))
69 +
   `(font-lock-negation-char-face ((t (:foreground ,fg-alt))))
70 +
   `(font-lock-preprocessor-face ((t (:foreground ,base7))))
71 +
   `(font-lock-string-face ((t (:foreground ,string))))
72 +
   `(font-lock-type-face ((t (:foreground ,orange))))
73 +
   `(font-lock-variable-name-face ((t (:foreground ,teal))))
74 +
   `(font-lock-warning-face ((t (:foreground ,orange))))
75 +
76 +
   ;; completion
77 +
   `(completions-common-part ((t (:foreground ,orange))))
78 +
   `(completions-first-difference ((t (:foreground ,fg :weight bold))))
79 +
   `(completions-annotations ((t (:foreground ,base6))))
80 +
81 +
   ;; org
82 +
   `(org-level-1 ((t (:foreground ,orange :weight bold))))
83 +
   `(org-level-2 ((t (:foreground ,string))))
84 +
   `(org-level-3 ((t (:foreground ,teal))))
85 +
   `(org-level-4 ((t (:foreground ,violet))))
86 +
   `(org-code ((t (:foreground ,string))))
87 +
   `(org-verbatim ((t (:foreground ,teal))))
88 +
   `(org-block ((t (:background ,base2 :extend t))))
89 +
   `(org-todo ((t (:foreground ,orange :weight bold))))
90 +
   `(org-done ((t (:foreground ,base6 :weight bold))))
91 +
92 +
   ;; diff / vc
93 +
   `(diff-added ((t (:foreground ,string))))
94 +
   `(diff-removed ((t (:foreground ,red))))
95 +
   `(diff-changed ((t (:foreground ,orange))))
96 +
97 +
   ;; ERC
98 +
   `(erc-default-face ((t (:foreground ,fg))))
99 +
   `(erc-timestamp-face ((t (:foreground ,base5))))
100 +
   `(erc-prompt-face ((t (:foreground ,orange :weight bold))))
101 +
   `(erc-notice-face ((t (:foreground ,base6))))
102 +
   `(erc-input-face ((t (:foreground ,string))))
103 +
   `(erc-my-nick-face ((t (:foreground ,orange :weight bold))))
104 +
   `(erc-nick-default-face ((t (:foreground ,teal :weight bold))))
105 +
   `(erc-nick-msg-face ((t (:foreground ,orange))))
106 +
   `(erc-direct-msg-face ((t (:foreground ,orange))))
107 +
   `(erc-action-face ((t (:foreground ,violet :slant italic))))
108 +
   `(erc-error-face ((t (:foreground ,red))))
109 +
   `(erc-current-nick-face ((t (:foreground ,orange :weight bold))))
110 +
   `(erc-keyword-face ((t (:foreground ,orange :weight bold))))
111 +
   `(erc-pal-face ((t (:foreground ,string :weight bold))))
112 +
   `(erc-fool-face ((t (:foreground ,base5))))
113 +
   `(erc-header-line ((t (:background ,bg :foreground ,fg-alt))))
114 +
   `(erc-button ((t (:foreground ,orange :underline t))))
115 +
   `(erc-bold-face ((t (:weight bold))))
116 +
   `(erc-underline-face ((t (:underline t))))
117 +
   `(erc-command-indicator-face ((t (:foreground ,base7 :weight bold))))
118 +
   `(erc-fill-wrap-merge-indicator-face ((t (:foreground ,base4))))))
119 +
120 +
(provide-theme 'darkmatter)
121 +
122 +
;;; darkmatter-theme.el ends here