13 KiB
Phil's Doom Emacs Config
Intro
This is my personal Doom Emacs config. The important bit is that I have some additional keybinds. This file is a catch-all for all the files in $DOOMDIR - you can use org-babel-tangle
to tangle them into their respective files.
Some of the comments are from the default config.el file that ships with Doom Emacs.
You can extract all the source/ config files from here by running Emacs and hitting C-c C-v t
.
config.el
Basic settings, Theme and Display
(setq user-full-name "Phil Bajsicki")
(setq global-auto-revert-mode t)
(setq auth-sources '("~/.authinfo"))
(after! counsel
(setq counsel-outline-display-style 'title))
(setq doom-font (font-spec :family "Iosevka" :size 12 :weight 'semi-light)
doom-variable-pitch-font (font-spec :family "Iosevka" :size 13))
(setq doom-theme 'doom-one)
(setq display-line-numbers-type 'relative)
(setq next-screen-context-lines 4)
(after! persp-mode
(setq persp-emacsclient-init-frame-behaviour-override "main"))
(setq doom-modeline-persp-name t)
Org-mode
If you use `org' and don't want your org files in the default location below, change `org-directory'. It must be set before org loads!
Make .org file automatically open in org-mode.
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(setq org-directory "~/enc/org/")
(setq org-contacts-files
(file-expand-wildcards "~/enc/org/*.org"))
(setq-default org-enforce-todo-dependencies t)
Org-contacts
Keybinds
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ch" 'counsel-org-link)
(global-set-key "\C-cne" 'elgantt-open)
Theming.
(setq org-superstar-special-todo-items t)
(setq org-fontify-todo-headline t)
(setq org-footnote-section nil)
(setq org-table-duration-hour-zero-padding nil)
Todo keywords
(setq org-todo-keywords
'((sequence
"INBOX(i)"
"TASK(t)" ; A task that needs doing & is ready to do
"PROJ(p)" ; A project, which usually contains other tasks
"LOOP(r)" ; A recurring task
"WAIT(w)" ; Something external is holding up this task
"HOLD(h)" ; This task is paused/on hold because of me
"|"
"DONE(d)" ; Task successfully completed
"KILL(k)") ; Task was cancelled, aborted or is no longer applicable
(sequence
"DECIDE()" ; for making decisions
"|"
"OKAY(o)" ; okay as-is
"YES(y)" ; take action
"NO(n)")) ; don't take action
org-todo-keyword-faces
'(("[-]" . +org-todo-active)
("STRT" . +org-todo-active)
("[?]" . +org-todo-onhold)
("WAIT" . +org-todo-onhold)
("HOLD" . +org-todo-onhold)
("PROJ" . +org-todo-project)
("NO" . +org-todo-cancel)
("KILL" . +org-todo-cancel)))
(setq hl-todo-keyword-faces
'(("HOLD" . "#d0bf8f")
("TODO" . "#cc9393")
("NEXT" . "#dca3a3")
("THEM" . "#dc8cc3")
("PROG" . "#7cb8bb")
("OKAY" . "#7cb8bb")
("DONT" . "#5f7f5f")
("FAIL" . "#8c5353")
("DONE" . "#afd8af")
("NOTE" . "#d0bf8f")
("KLUDGE" . "#d0bf8f")
("HACK" . "#d0bf8f")
("TEMP" . "#d0bf8f")
("FIXME" . "#cc9393")
("XXXX*" . "#cc9393")))
Capture templates
(setq org-capture-templates '(("t" "inbox" entry (file+headline "~/enc/org/phil.org" "Inbox") "* TODO %i%?")
("i" "idea" entry (file+headline "~/enc/org/phil.org" "Ideas") "* %?")
("d" "reminder" entry (file+headline "~/enc/org/phil.org" "Reminders") "* %i%? \n %U")
("p" "person" entry (file+headline "~/enc/org/people.org" "People")
"* %(org-contacts-template-name)
:PROPERTIES:
:EMAIL: %(org-contacts-template-email)
:PHONE: %(org-contacts-template-phone)
:ALIAS:
:NICKNAME:
:IGNORE:
:ICON:
:NOTE:
:ADDRESS:
:BIRTHDAY:
:END:")))
Org-wild-notifier
This lets me get desktop notifications for TODO items.
(org-wild-notifier-mode)
(setq org-wild-notifier-alert-time '(10))
(setq org-wild-notifier-notification-title "Emacs org-mode agenda")
(setq org-wild-notifier-keyword-whitelist '("TODO"))
Org-refile
(setq org-refile-targets '((nil :maxlevel . 9)
(org-agenda-files :maxlevel . 9)))
(setq org-outline-path-complete-in-steps nil)
(setq org-refile-use-outline-path t)
(setq find-file-visit-truename t)
Org-roam
Keybinds
(define-prefix-command 'org-roam-map)
(global-set-key "\C-r" 'org-roam-map)
(define-key org-roam-map "o" 'org-roam-buffer-toggle)
(define-key org-roam-map "f" 'org-roam-node-find)
(define-key org-roam-map "i" 'org-roam-node-insert)
(define-key org-roam-map "n" 'org-roam-capture)
Org-roam
(setq org-roam-v2-ack t)
(setq org-roam-completion-everywhere t)
(setq org-roam-directory
(file-truename "~/enc/org/roam"))
(org-roam-db-autosync-mode)
(org-roam-db-autosync-enable)
(setq org-roam-capture-templates
'(("r" "default" plain
"%?"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
:unnarrowed t)))
Org-elgantt
(add-to-list 'load-path "~/.emacs.d/.local/straight/repos/elgantt/")
(setq elgantt-header-type 'outline
elgantt-draw-overarching-headers t
elgantt-insert-header-even-if-no-timestamp nil
elgantt-scroll-to-current-month-at-startup t)
(setq elgantt-user-set-color-priority-counter 0)
(setq elgantt-custom-header-line
'((:left ((:prop date-at-point
:padding 25)
(:prop todo
:padding 30)))
(:center ((:prop headline)))
(:right ((:prop hashtag
:padding 40
:text-props (face (:background "red")))))))
Org-agenda
Keybinds
(global-set-key "\C-ca" 'org-agenda)
(define-prefix-command 'org-agenda-map)
(global-set-key "\C-a" 'org-agenda-map)
(define-key org-agenda-map "n" 'org-agenda-capture)
(define-key org-agenda-map "a" 'org-agenda)
Settings
(setq org-agenda-files '("~/enc/org/org-agenda-files.org"))
(setq org-agenda-start-day nil
org-agenda-span '14
org-agenda-dim-blocked-tasks 'invisible
org-agenda-sorting-strategy
'((agenda habit-down time-up priority-down category-keep)
(todo priority-down category-keep)
(search category-keep))
org-deadline-warning-days 3
org-agenda-include-diary "~/enc/org/phil-journal.org"
org-agenda-insert-diary-extract-time t
org-log-into-drawer t
org-clock-into-drawer t
org-agenda-log-mode-items '(closed clock state))
Yasnippets
(setq doom-snippets-enable-short-helpers t)
custom.el
Custom variables. Note that this file is generally set up automatically by Emacs, so I'm not exporting this block. I'm keeping the default warning commants in just for completion here.
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(org-safe-remote-resources
'("\\`https://bajsicki\\.com/org-html-themes/org/theme-readtheorg\\.setup\\'")))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
init.el
This is the state as of <2023-08-12 Sat>. I'm sure Doom Emacs will expand/ change/ add/ remove things over time, but this is what I use right now.
input
(doom! :input
completion
:completion
company
ivy
ui
:ui
doom
doom-dashboard
doom-quit
(emoji +unicode)
hl-todo
ligatures
modeline
ophints
(popup +defaults)
treemacs
unicode
vi-tilde-fringe
workspaces
editor
:editor
file-templates
fold
(format +onsave)
snippets
word-wrap
emacs
:emacs
dired
electric
undo
vc
term
:term
vterm
checkers
:checkers
syntax
tools
:tools
(eval +overlay)
lookup
lsp
magit
pdf
lang
:lang
common-lisp
data
emacs-lisp
(haskell +lsp)
latex
org
plantuml
raku
shipsweb
rust
yaml
zig
config
:config
;literate
(default +bindings +smartparens)
closing
)
packages.el
Info from the included (default) comments:
To install a package with Doom you must declare them here and run 'doom sync' on the command line, then restart Emacs for the changes to take effect – or use 'M-x doom/reload'.
Install from MELPA, ELPA or emacsmirror:
(package! some-package)
Install a package directly from git repo:
Specify a :recipe
. Documentation.
(package! another-package :recipe (:host github
:repo "username/repo"))
If there is no PACKAGENAME.el file, or it's in a subdirectory, specify :files
in the :recipe
:
(package! this-package
:recipe (:host github :repo "username/repo"
:files ("some-file.el" "src/lisp/*.el")))
Disable packages included with Doom Emacs:
~(package! builtin-package :disable t)~
Override package recipe:
If a property in a :recipe
isn't specified, it will use defaults from Doom/MELPA/ELPA/Emacsmirror.
(package! builtin-package :recipe (:nonrecursive t))
(package! builtin-package-2 :recipe (:repo "myfork/package"))
You can override the recipe of a built in package without having to specify all the properties for `:recipe'. These will inherit the rest of its recipe from Doom or MELPA/ELPA/Emacsmirror:
Install package from specific branch:
You can set the :branch
property. This is required for some packages.
(package! builtin-package :recipe (:branch "develop"))
Install a specific commit:
You can set :pin
.
(package! builtin-package :pin "1a2b3c4d5e")
Unpin a commit:
Doom's packages are pinned to a specific commit and updated from release to
release. You can unpin!
them. Note (unpin! t)
unpins all the packages and can break your Emacs.
(unpin! pinned-package)
(unpin! pinned-package another-pinned-package)
(unpin! t)
#+end_#+begin_src
Packages:
Core
;; -*- no-byte-compile: t; -*-
;;; $DOOMDIR/packages.el
(unpin! straight)
(package! beacon)
(package! counsel)
(package! deft)
Modes:
(package! battle-haxe)
(package! fish-mode)
(package! typescript-mode)
(package! wc-mode)
Ivy
(package! ivy)
(package! ivy-xref)
Org
(package! org-contacts)
(package! org-download)
(package! org-cliplink)
(package! org-roam)
(package! org-ql)
(package! org-wild-notifier)
Org-depend
Ensure task dependencies are met.
(package! org-depend
:recipe (
:host github
:repo "fgeller/org-mode"
:files ("contrib/lisp/org-depend.el")))
Elgantt
Pretty Gantt chart for your agenda.
(package! elgantt
:recipe (:host github :repo "legalnonsense/elgantt"))