My Emacs config, I guess. Making it literate cuz it’s probably gonna become huge in a few months and I wanna prepare for it.
Probably the only good piece of code I’ll write here.
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
Here, I publicize my name and email address. Please don’t spam me.
(setq user-full-name "Daniel Xu"
user-mail-address "[email protected]")
I use emacs on both my openSUSE Thinkpad and my Macbook Air. I don’t use scaling on my Thinkpad, so make the font size bigger there.
(setq doom-font
(font-spec :family "BerkeleyMono Nerd Font"
:size (if (eq system-type 'darwin) 14 17))
doom-variable-pitch-font
(font-spec :family "Inter"
:size (if (eq system-type 'darwin) 14 17)))
Use gruvbox material as my colorscheme
(setq doom-theme 'catppuccin)
Line numbers are pretty slow all around. The performance boost of disabling them outweighs the utility of always keeping them on.
;; (setq display-line-numbers-type nil)
(setq display-line-numbers-type 'relative)
Prevents some cases of Emacs flickering.
(add-to-list 'default-frame-alist '(inhibit-double-buffering . t))
Make the dashboard more minimal, removing the menus and adding a nice Emacs logo.
(setq fancy-splash-image (file-name-concat doom-user-dir "splash.png"))
(setq +doom-dashboard-functions '(doom-dashboard-widget-banner))
(setq-default
delete-by-moving-to-trash t ; Delete files to trash
window-combination-resize t ; take new window space from all other windows (not just current)
x-stretch-cursor t) ; Stretch cursor to the glyph width
(setq undo-limit 80000000 ; Raise undo-limit to 80Mb
evil-want-fine-undo t ; By default while in insert all changes are one big blob. Be more granular
auto-save-default t ; Nobody likes to loose work, I certainly don't
truncate-string-ellipsis "…" ; Unicode ellispis are nicer than "...", and also save /precious/ space
password-cache-expiry nil ; I can trust my computers ... can't I?
;; scroll-preserve-screen-position 'always ; Don't have `point' jump around
scroll-margin 2 ; It's nice to maintain a little margin
display-time-default-load-average nil) ; I don't think I've ever found this useful
(display-time-mode 1) ; Enable time in the mode-line
(global-subword-mode 1) ; Iterate through CamelCase words
I can easily maximize an Emacs pane with a hotkey.
(add-to-list 'default-frame-alist '(height . 24))
(add-to-list 'default-frame-alist '(width . 80))
I find it rather handy to be asked which buffer I want to see after splitting the window. Let’s make that happen.
First, we’ll enter the new window
(setq evil-vsplit-window-right t
evil-split-window-below t)
Then, we’ll pull up a buffer prompt.
(defadvice! prompt-for-buffer (&rest _)
:after '(evil-window-split evil-window-vsplit)
(consult-buffer))
Set org directory to my synced Documents folder.
(setq org-directory "~/Documents/notes")
Set up org-roam ui
(use-package! websocket
:after org-roam)
(use-package! org-roam-ui
:after org-roam ;; or :after org
;; :hook (after-init . org-roam-ui-mode)
:config
(setq org-roam-ui-sync-theme t
org-roam-ui-follow t
org-roam-ui-update-on-save t
org-roam-ui-open-on-start t))
I like Corfu, but I don’t like being spammed by it.
(setq corfu-auto-delay 0.5)