doom

My literate doom emacs config
git clone https://github.com/michaelneuper/doom.git
Files | Log | Refs

commit fb2587c4424baed9e329ddad7e206f2e91a623b8
parent 18d4d03f20d0a302f319a5deb0b70be3f73ed55a
Author: Michael Neuper <michael@michaelneuper.com>
Date:   Sat, 16 May 2026 11:28:46 +0200

refactor

Diffstat:
Mconfig.org | 61++++++++++++++++++++++++++++++++++++++-----------------------
Minit.el | 4++--
2 files changed, 40 insertions(+), 25 deletions(-)

diff --git a/config.org b/config.org @@ -1,6 +1,6 @@ #+title: Doom Emacs Config #+author: Michael Neuper -#+startup: content +#+startup: content noinlineimages This is my literate doom emacs config. [[#basic][Basic]] sets up some basic emacs and doom configurations. @@ -48,14 +48,14 @@ Make this file run slightly faster (see [[https://nullprogram.com/blog/2016/12/2 Make emacs faster. #+begin_src emacs-lisp (use-package! gcmh + :defer nil :init (setq gcmh-idle-delay 5 gcmh-high-cons-threshold (* 256 1024 1024)) ; 256MB during idle :config (gcmh-mode 1)) - -(setq gc-cons-threshold 200000000) ; previous 33554432 #+end_src + *** Basic #+begin_src emacs-lisp ;; credentials @@ -66,6 +66,9 @@ Make emacs faster. (setq auto-save-default t make-backup-files t) +;; refresh buffers when files change on disk +(global-auto-revert-mode 1) + ;; kill emacs without confiming (setq confirm-kill-emacs nil) @@ -192,7 +195,14 @@ Enable relative line numbers and make their slant normal (not italic). Only highlight the current line in programming modes and =dired=. #+begin_src emacs-lisp -(setq global-hl-line-modes '(prog-mode dired-mode)) +(setq global-hl-line-modes '(prog-mode dired-mode)) ;; FIXME not showing in dired +#+end_src + +Give highlighted lines a slightly blue background. +#+begin_src emacs-lisp +(custom-set-faces! + `(region + :background ,(doom-blend (doom-color 'blue) (doom-color 'bg) 0.2))) #+end_src *** Window Start emacs in a 100x40 window. @@ -318,8 +328,8 @@ Set a custom ascii banner for when emacs is used in the terminal, and a splash i *** indent-guides Disable =indent-bars= by default. #+begin_src emacs-lisp -(after! indent-bars - (add-hook '+indent-guides-inhibit-functions (lambda () t))) +(add-hook '+indent-guides-inhibit-functions + (lambda () t)) #+end_src *** modeline Make the modeline look a bit nicer. @@ -572,25 +582,27 @@ Set some =evil= variables and define some keybindings. evil-respect-visual-line-mode t evil-want-fine-undo t evil-move-beyond-eol t - ;; evil-want-minibuffer t + ;; evil-want-minibuffer t ; enable `evil-mode' in the minibuffer +evil-want-o/O-to-continue-comments nil) - (when (eq doom-theme 'doom-gruvbox) - (defconst my/gruvbox-blue "#83a598") ; (doom-color 'blue) - - (setq evil-normal-state-cursor `(box ,my/gruvbox-blue) - evil-insert-state-cursor `(bar ,my/gruvbox-blue) - evil-visual-state-cursor `(hollow ,my/gruvbox-blue) - evil-replace-state-cursor `(hbar ,my/gruvbox-blue))) - - (custom-theme-set-faces! 'doom-gruvbox - `(region :background ,(doom-blend (doom-color 'blue) (doom-color 'bg) 0.2))) - (map! :nv "~" #'repeat :prefix "g" :nv "y" #'evilnc-copy-and-comment-operator :nv "Y" #'+evil:yank-unindented)) #+end_src + +Make the cursor blue when the theme is gruvbox. +#+begin_src emacs-lisp +(after! evil + (when (eq doom-theme 'doom-gruvbox) + ;; this needs to be defined as a constant since evil gets loaded before doom-color + (defconst my/gruvbox-blue "#83a598") ; (doom-color 'blue) + + (setq evil-normal-state-cursor `(box ,my/gruvbox-blue) + evil-insert-state-cursor `(bar ,my/gruvbox-blue) + evil-visual-state-cursor `(hollow ,my/gruvbox-blue) + evil-replace-state-cursor `(hbar ,my/gruvbox-blue)))) +#+end_src *** format #+begin_src emacs-lisp (map! :map apheleia-mode-map @@ -616,6 +628,10 @@ Add a toggle for =lispy-mode=. (map! :leader :desc "Lispy" "t L" #'my/toggle-lispy) #+end_src *** whitespace +#+begin_src emacs-lisp +(setq +whitespace-guess-in-projects t) +#+end_src + This package shows whitespace characters like tabs and spaces in the selected region. [[https://raw.githubusercontent.com/michaelneuper/doom/main/images/whitespace.png]] @@ -1202,7 +1218,7 @@ Set some =org= variables. org-edit-src-content-indentation 0) ;; FIXME blurry previews when using #+attr_org: :width -;; this only seems to be an issue when using emacs-plus +;; this only seems to be an issue when using emacs-plus (as opposed to emacs-mac) ;; (setq org-image-actual-width (/ (display-pixel-width) 3)) ; set images to a third of the width of the screen ;; org-image-actual-width (min (/ (display-pixel-width) 3) 800) #+end_src @@ -1622,10 +1638,9 @@ Set up =org-roam= along with keybindings that have the [[kbd:][<leader> r]] pref :config (setq nasm-after-mnemonic-whitespace :space) (custom-set-faces! - ;; `(nasm-instructions :foreground ,(doom-color 'cyan)) - ;; `(nasm-registers :foreground ,(doom-color 'violet)) - ;; `(nasm-local-labels :foreground ,(doom-color 'yellow)) - )) + `(nasm-instructions :foreground ,(doom-color 'cyan)) + `(nasm-registers :foreground ,(doom-color 'violet)) + `(nasm-local-labels :foreground ,(doom-color 'yellow)))) #+end_src ** :app *** calendar diff --git a/init.el b/init.el @@ -130,7 +130,7 @@ ;;idris ; a language you can depend on (json +tree-sitter) ; At least it ain't XML (java +lsp +tree-sitter) ; the poster child for carpal tunnel syndrome - javascript ; all(hope(abandon(ye(who(enter(here)))))) + (javascript +tree-sitter) ; all(hope(abandon(ye(who(enter(here)))))) ;;julia ; a better, faster MATLAB ;;kotlin ; a better, slicker Java(Script) (latex +cdlatex +lsp) ; writing papers in Emacs has never been so fun @@ -163,7 +163,7 @@ ;;terra ; Earth and Moon in alignment for performance. (web +tree-sitter) ; the tubes yaml ; JSON, but readable - ;;zig ; C, but simpler + (zig +lsp +tree-sitter) ; C, but simpler :email ;;(mu4e +org +gmail)