Skip to content
This is my private DOOM emacs configuration.
Emacs Lisp YASnippet
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
attachments added GTD babel for plantuml Jan 20, 2020
snippets updates Feb 10, 2020
config.el removed fitness Feb 10, 2020 removed fitness Feb 10, 2020
init.el updates Feb 10, 2020
packages.el updates Feb 10, 2020

Table of Contents

My DOOM emacs private configuration: img

High focus on GTD process workflow: (source)


Getting started

If you have not installed DOOM Emacs but would like to:

git clone ~/.doom.d
git clone ~/.emacs.d
~/.emacs.d/bin/doom install

Otherwise, backup your existing DOOM private config and run:

mv ~/.doom.d ~/.doom.d_backup
git clone ~/.doom.d
~/.emacs.d/bin/doom refresh

This repo uses a literate configuration, with basic settings in ./init.el, ./packags.el, the content of ./config.el will be generated from the Emacs Lisp code blocks in This readme file gets created when exporting to markdown.

General Settings


For this we just make small tweaks to line numbers.

(setq display-line-numbers t)


(global-set-key (kbd "C-c C-x i") #'org-mru-clock-in)
(global-set-key (kbd "C-c C-x C-j") #'org-mru-clock-select-recent-task)
(bind-key "C-<down>" #'+org/insert-item-below)
 :nvime "<f5> d" #'helm-org-rifle-directories
 :nvime "<f5> b" #'helm-org-rifle-current-buffer
 :nvime "<f5> o" #'helm-org-rifle-org-directory
 :nvime "<f5> a" #'helm-org-rifle-agenda-files)

(map! :leader
      :n "e" #'ace-window
      :n "!" #'swiper
      :n "@" #'swiper-all
      :n "#" #'deadgrep
      :n "$" #'helm-org-rifle-directories
      :n "X" #'org-capture
      (:prefix "o"
        :n "e" #'elfeed
        :n "g" #'metrics-tracker-graph
        :n "o" #'org-open-at-point
        :n "u" #'elfeed-update
        :n "w" #'deft)
      (:prefix "f"
        :n "o" #'plain-org-wiki-helm)
      (:prefix "n"
        :n "D" #'dictionary-lookup-definition
        :n "T" #'powerthesaurus-lookup-word)
      (:prefix "s"
        :n "d" #'deadgrep
        :n "q" #'org-ql-search
        :n "b" #'helm-org-rifle-current-buffer
        :n "o" #'helm-org-rifle-org-directory
        :n "." #'helm-org-rifle-directories)
      (:prefix "b"
        :n "c" #'org-board-new
        :n "e" #'org-board-open)
      (:prefix "t"
        :n "s" #'org-narrow-to-subtree
        :n "w" #'widen)
      (:prefix "/"
        :n "j" #'org-journal-search))

General settings

(setq-default fill-column 80)
(global-auto-revert-mode t)

Popup Rules

(after! org (set-popup-rule! "^Capture.*\\.org$" :side 'right :size .40 :select t :vslot 2 :ttl 3))
(after! org (set-popup-rule! "Dictionary" :side 'bottom :height .40 :width 20 :select t :vslot 3 :ttl 3))
(after! org (set-popup-rule! "*helm*" :side 'bottom :height .40 :select t :vslot 5 :ttl 3))
(after! org (set-popup-rule! "*eww*" :side 'right :size .40 :slect t :vslot 5 :ttl 3))
(after! org (set-popup-rule! "*deadgrep" :side 'bottom :height .40 :select t :vslot 4 :ttl 3))
(after! org (set-popup-rule! "*org-roam" :side 'right :size .40 :select t :vslot 4 :ttl 3))
(after! org (set-popup-rule! "\\Swiper" :side 'bottom :size .30 :select t :vslot 4 :ttl 3))
(after! org (set-popup-rule! "*xwidget" :side 'right :size .40 :select t :vslot 5 :ttl 3))
(after! org (set-popup-rule! "*org agenda*" :side 'right :size .40 :select t :vslot 2 :ttl 3))
(after! org (set-popup-rule! "*Org ql" :side 'right :size .40 :select t :vslot 2 :ttl 3))

User Settings

(setq user-full-name "Nicholas Martin"
      user-mail-address "")

Doom Settings


For fonts please download Input and DejaVu

(setq doom-font (font-spec :family "InputMono" :size 20)
      doom-variable-pitch-font (font-spec :family "InputMono" :height 120)
      doom-unicode-font (font-spec :family "InputMono")
      doom-big-font (font-spec :family "InputMono" :size 20))
(prefer-coding-system       'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8)

Mode line

(setq doom-modeline-gnus t
      doom-modeline-gnus-timer 'nil)


(setq doom-theme 'doom-gruvbox)

Org Mode Settings


(after! org (setq org-agenda-use-time-grid nil
                  org-agenda-skip-scheduled-if-done t
                  org-agenda-skip-deadline-if-done t
                  org-habit-show-habits t))
(after! org (setq org-super-agenda-groups
                  '((:auto-category t))))

Load all *.org files to agenda

(load-library "find-lisp")
(after! org (setq org-agenda-files
(find-lisp-find-files "~/.org/" "\.org$")))


(after! org (setq org-capture-templates
                  '(("t" "Tasks")
                    ("p" "Projects")
                    ("r" "References"))))

Append sub-heading to current

(after! org (add-to-list 'org-capture-templates
             '("ta" "Append new entry to existing header" entry (file+function buffer-name org-back-to-heading-or-point-min)
"* %^{topic}

%?" :clock-in t :clock-resume t)))


(after! org (add-to-list 'org-capture-templates
             '("c" "Capture [GTD]" entry (file "~/.org/gtd/")
"* TODO %^{taskname}%?
" :immediate-finish t)))

New parent with child task

(after! org (add-to-list 'org-capture-templates
             '("tp" "Add Parent w/child to Current" entry (file+function buffer-name org-back-to-heading-or-point-min)
"* TODO %^{taskname}


\** TODO %^{child task}" :clock-in t :clock-resume t)))

New Project

ID: bed0315c-b641-4a08-97ac-570a741181fb

(after! org (add-to-list 'org-capture-templates
             '("pn" "New Project" entry (file+function my/generate-org-note-name org-back-to-heading-or-point-min)
"* TODO %^{projectname}
:GOAL:    %^{goal}


\** TODO %^{task1}")))

New Task in heading

(after! org (add-to-list 'org-capture-templates
             '("tc" "Add Task to Current" entry (file+function buffer-name org-back-to-heading-or-point-min)
"* TODO %^{taskname}

%?" :clock-in t :clock-resume t)))

Recurring Tasks

(after! org (add-to-list 'org-capture-templates
                         '("tr" "Recurring Task" entry (file "~/.org/gtd/")
                           "* TODO %^{description} %?
:SCHEDULED: %^{schedule}t

Reference - New Entry

ID: 872e98d3-c9bf-42ca-9e91-d62a5b61bf34

(after! org (add-to-list 'org-capture-templates
             '("rn" "Yank new Example" entry(file+headline"~/.org/notes/" "INBOX")
"* %^{example}
:CATEGORY: %^{category}
:SUBJECT:  %^{subject}


Reference - Yank Example

ID: a92854f8-81a0-48cc-923d-0ae0eeddf49d

(after! org (add-to-list 'org-capture-templates
             '("re" "Yank new Example" entry(file+headline"~/.org/notes/" "INBOX")
"* %^{example}
:SOURCE:  %^{source|Command|Script|Code|Usage}
:SUBJECT: %^{subject}

\#+BEGIN_SRC %^{lang}


(after! org (add-to-list 'org-capture-templates
             '("w" "Workout Log" entry(file+olp+datetree"~/.org/journal/")
               "** %\\1 (%\\2 calories) :: %\\3 (reps)
:REPS:     %^{REPS}


(after! org (add-to-list 'org-capture-templates
             '("F" "Food Log" entry(file+olp+datetree"~/.org/journal/")
"** %\\1 [%\\2]
:FOOD:     %^{FOOD}


(after! org (add-to-list 'org-capture-templates
             '("d" "Diary Log" entry(file+datetree"~/.org/journal/")
               "** <%<%I:%M:%S>> %^{diary entry}


(after! org (setq org-directory "~/.org/"
                  org-image-actual-width nil
                  +org-export-directory "~/.export/"
                  org-archive-location "~/.org/gtd/"
                  org-default-notes-file "~/.org/gtd/"
                  projectile-project-search-path '("~/")))


(after! org (setq org-html-head-include-scripts t
                  org-export-with-toc t
                  org-export-with-author t
                  org-export-headline-levels 5
                  org-export-with-drawers t
                  org-export-with-email t
                  org-export-with-footnotes t
                  org-export-with-latex t
                  org-export-with-section-numbers nil
                  org-export-with-properties t
                  org-export-with-smart-quotes t
                  org-export-backends '(pdf ascii html latex odt pandoc)))

TODO Faces

Need to add condition to adjust faces based on theme select.

(after! org (setq org-todo-keyword-faces
      '(("TODO" :foreground "tomato" :weight bold)
        ("WAITING" :foreground "light sea green" :weight bold)
        ("STARTED" :foreground "DodgerBlue" :weight bold)
        ("DELEGATED" :foreground "Gold" :weight bold)
        ("NEXT" :foreground "violet red" :weight bold)
        ("DONE" :foreground "slategrey" :weight bold))))


(after! org (setq org-todo-keywords
      '((sequence "TODO(t)" "WAITING(w!)" "STARTED(s!)" "NEXT(n!)" "DELEGATED(e!)" "|" "INVALID(I!)" "DONE(d!)"))))

TODO Latex Exports

Getting errors on start up for this one. Will need to look into it.

(add-to-list 'org-latex-classes
\\usepackage{courier} % tt
\\geometry{letter, textwidth=6.5in, textheight=10in,
            marginparsep=7pt, marginparwidth=.6in}"
               ("\\section{%s}" . "\\section*{%s}")
               ("\\subsection{%s}" . "\\subsection*{%s}")
               ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
               ("\\paragraph{%s}" . "\\paragraph*{%s}")
               ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))

Link Abbreviations

(after! org (setq org-link-abbrev-alist
                  '(("doom-repo" . "")
                    ("wolfram" . "")
                    ("duckduckgo" . "")
                    ("gmap" . "")
                    ("gimages" . "")
                    ("google" . "")
                    ("youtube" . "")
                    ("youtu" . "")
                    ("github" . "")
                    ("attachments" . "~/.org/.attachments/"))))

Logging & Drawers

(after! org (setq org-log-state-notes-insert-after-drawers nil
                  org-log-into-drawer t
                  org-log-done 'time
                  org-log-repeat 'time
                  org-log-redeadline 'note
                  org-log-reschedule 'note))

Pitch Settings


(after! org (setq org-bullets-bullet-list '("◉" "○")
                  org-hide-emphasis-markers nil
                  org-list-demote-modify-bullet '(("+" . "-") ("1." . "a.") ("-" . "+"))
                  org-ellipsis "▼"))
(setq org-emphasis-alist
  '(("*" (bold :foreground "Orange" ))
    ("/" italic)
    ("_" underline)
    ("=" (:foreground "maroon"))
    ("~" (:foreground "deep sky blue"))
    ("+" (:strike-through t))))


(after! org (setq org-publish-project-alist
                     :base-directory "~/.org/notes/images/"
                     :base-extension "jpg\\|jpeg\\|png\\|pdf\\|css"
                     :publishing-directory "~/publish_html/references/images"
                     :publishing-function org-publish-attachment)
                     :base-directory "~/.org/notes/"
                     :publishing-directory "~/publish_md"
                     :base-extension "org"
                     :recursive t
                     :headline-levels 5
                     :publishing-function org-html-publish-to-html
                     :section-numbers nil
                     :html-head "<link rel=\"stylesheet\" href=\"\" type=\"text/css\"/>"
                     :infojs-opt "view:t toc:t ltoc:t mouse:underline buttons:0 path:"
                     :with-email t
                     :with-toc t)
                     :base-directory "~/.org/gtd/"
                     :publishing-directory "~/publish_tasks"
                     :base-extension "org"
                     :recursive t
                     :auto-sitemap t
                     :sitemap-filename "index"
                     :html-link-home "../index.html"
                     :publishing-function org-html-publish-to-html
                     :section-numbers nil
                     ;:html-head "<link rel=\"stylesheet\"
                     :with-email t
                     :html-link-up ".."
                     :auto-preamble t
                     :with-toc t)
                     :base-directory "~/.org/gtd/references/"
                     :base-extension "org"
                     :publishing-directory "~/publish"
                     :preparation-function somepreparationfunction
                     :completion-function  somecompletionfunction
                     :publishing-function org-latex-publish-to-pdf
                     :recursive t
                     :latex-class "koma-article"
                     :headline-levels 5
                     :with-toc t)
                    ("myprojectweb" :components("references-attachments" "pdf" "references-md" "tasks")))))


(after! org (setq org-refile-targets '((org-agenda-files . (:maxlevel . 6)))
                  org-outline-path-complete-in-steps nil
                  org-refile-allow-creating-parent-nodes 'confirm))


(after! org (setq org-startup-indented t
                  org-src-tab-acts-natively t))
(add-hook 'org-mode-hook 'variable-pitch-mode)
(add-hook 'org-mode-hook 'visual-line-mode)
(add-hook 'org-mode-hook (lambda () (org-autolist-mode)))
(add-hook 'org-agenda-finalize-hook 'org-timeline-insert-timeline :append)

;(add-hook 'org-mode-hook 'org-num-mode)


(after! org (setq org-tags-column -80))
(after! org (setq org-tag-alist '((:startgrouptag)

Extra Modules


(defun my-deft/strip-quotes (str)
  (cond ((string-match "\"\\(.+\\)\"" str) (match-string 1 str))
        ((string-match "'\\(.+\\)'" str) (match-string 1 str))
        (t str)))

(defun my-deft/parse-title-from-front-matter-data (str)
  (if (string-match "^title: \\(.+\\)" str)
      (let* ((title-text (my-deft/strip-quotes (match-string 1 str)))
             (is-draft (string-match "^draft: true" str)))
        (concat (if is-draft "[DRAFT] " "") title-text))))

(defun my-deft/deft-file-relative-directory (filename)
  (file-name-directory (file-relative-name filename deft-directory)))

(defun my-deft/title-prefix-from-file-name (filename)
  (let ((reldir (my-deft/deft-file-relative-directory filename)))
    (if reldir
        (concat (directory-file-name reldir) " > "))))

(defun my-deft/parse-title-with-directory-prepended (orig &rest args)
  (let ((str (nth 1 args))
        (filename (car args)))
      (my-deft/title-prefix-from-file-name filename)
      (let ((nondir (file-name-nondirectory filename)))
        (if (or (string-prefix-p "README" nondir)
                (string-suffix-p ".txt" filename))
          (if (string-prefix-p "---\n" str)
               (car (split-string (substring str 4) "\n---\n")))
            (apply orig args)))))))

(provide 'my-deft-title)

(use-package deft
  :bind (("<f8>" . deft))
  :commands (deft deft-open-file deft-new-file-named)
  (setq deft-directory "~/.org/notes/"
        deft-auto-save-interval 0
        deft-use-filename-as-title nil
        deft-current-sort-method 'title
        deft-recursive t
        deft-extensions '("md" "txt" "org")
        deft-markdown-mode-title-level 1
        deft-file-naming-rules '((noslash . "-")
                                 (nospace . "-")
                                 (case-fn . downcase))))
(require 'my-deft-title)
(advice-add 'deft-parse-title :around #'my-deft/parse-title-with-directory-prepended)


(use-package elfeed
  (setq elfeed-db-directory "~/.elfeed/"))

(use-package elfeed-org
  (setq rhm-elfeed-org-files (list "~/.elfeed/")))

(require 'elfeed)
(require 'elfeed-org)
(after! org (setq rmh-elfeed-org-files (list "~/.elfeed/")
                  elfeed-db-directory "~/.elfeed/"))


;(use-package gnuplot
;  :config
;  (setq gnuplot-program "gnuplot"))

Grip Mode

Org Agenda Prefix

(defun my-agenda-prefix ()
  (format "%s" (my-agenda-indent-string (org-current-level))))

(defun my-agenda-indent-string (level)
  (if (= level 1)
    (let ((str ""))
      (while (> level 2)
        (setq level (1- level)
              str (concat str "──")))
      (concat str "►"))))

Org Agenda Property

;(after! org (setq org-agenda-property-list '("WHO" "NEXTACT")
;                  org-agenda-property-position 'where-it-fits))

Org Outlook

(require 'org)

(org-add-link-type "outlook" 'org-outlook-open)

(defun org-outlook-open (id)
   "Open the Outlook item identified by ID.  ID should be an Outlook GUID."
   (w32-shell-execute "open" (concat "outlook:" id)))

(provide 'org-outlook)
(require 'org-outlook)

Org Clock Switch

(defun org-clock-switch ()
  "Switch task and go-to that task"
  (setq current-prefix-arg '(12)) ; C-u
  (call-interactively 'org-clock-goto)
(provide 'org-clock-switch)

Org Clock MRU

(setq org-mru-clock-how-many 10)
(setq org-mru-clock-completing-read #'ivy-completing-read)
(setq org-mru-clock-keep-formatting t)
(setq org-mru-clock-files #'org-agenda-files)

Org Mind Map

;(use-package org-mind-map
;  :init
;  (require 'ox-org)
;  ;; Uncomment the below if 'ensure-system-packages` is installed
;  ;;:ensure-system-package (gvgen . graphviz)
;  :config
;  (setq org-mind-map-engine "dot")       ; Default. Directed Graph
;  ;; (setq org-mind-map-engine "neato")  ; Undirected Spring Graph
;  ;; (setq org-mind-map-engine "twopi")  ; Radial Layout
;  ;; (setq org-mind-map-engine "fdp")    ; Undirected Spring Force-Directed
;  ;; (setq org-mind-map-engine "sfdp")   ; Multiscale version of fdp for the layout of large graphs
;  ;; (setq org-mind-map-engine "twopi")  ; Radial layouts
;  ;; (setq org-mind-map-engine "circo")  ; Circular Layout
;  )

Org Rifle

ID: 3256ce1c-aa68-4b99-823c-4c8fd6545c0b

I’ll want to add some of my own custom rifle actions here.


(use-package ob-plantuml
  :ensure nil
  (setq org-plantuml-jar-path (expand-file-name "~/.tools/plantuml.jar")))

Update Tickboxes

(defun org-update-cookies-after-save()
  (let ((current-prefix-arg '(4)))
    (org-update-statistics-cookies "ALL")))

(add-hook 'org-mode-hook
          (lambda ()
            (add-hook 'before-save-hook 'org-update-cookies-after-save nil 'make-it-local)))
(provide 'org-update-cookies-after-save)

WSL Browser

(defun my--browse-url (url &optional _new-window)
  ;; new-window ignored
  "Opens link via powershell.exe"
  (interactive (browse-url-interactive-arg "URL: "))
  (let ((quotedUrl (format "start '%s'" url)))
    (apply 'call-process "/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe" nil
           0 nil
           (list "-Command" quotedUrl))))

(setq-default browse-url-browser-function 'my--browse-url)


(defun zyrohex/org-notes-refile ()
  "Process an item to the references bucket"
  (let ((org-refile-targets '(("~/.gtd/" :maxlevel . 6)))
        (org-refile-allow-creating-parent-nodes 'confirm))
    (call-interactively #'org-refile)))
(provide 'zyrohex/org-notes-refile)


(defun zyrohex/org-reference-refile (arg)
  "Process an item to the reference bucket"
  (interactive "P")
  (let ((org-refile-targets '(("~/.gtd/" :maxlevel . 6))))
    (call-interactively #'org-refile)))
(provide 'zyrohex/org-reference-refile)


(defun zyrohex/org-tasks-refile ()
  "Process a single TODO task item."
  (call-interactively 'org-agenda-schedule)
  (let ((org-refile-targets '((helm-read-file-name :maxlevel .6)))
        (call-interactively #'org-refile))))
(provide 'zyrohex/org-tasks-refile)

Move capture

ID: d687b67d-0ca2-44c1-8acf-c1c807d1906e

(defun my/last-captured-org-note ()
  "Move to the last line of the last org capture note."
  (goto-char (point-max)))

Prompt filename

ID: fa8ee6b6-aefd-4dd2-94b5-592bff088b6d

(defun my/generate-org-note-name ()
  (setq my-org-note--name (read-string "Name: "))
  (expand-file-name (format ""my-org-note--name) "~/.org/gtd/projects/"))

Super Agenda Groups

(org-super-agenda-mode t)
(after! org-agenda (setq org-agenda-custom-commands
                         '(("k" "Tasks"
                            ((agenda ""
                                     ((org-agenda-files '("~/.org/gtd/" "~/.org/gtd/" "~/.org/gtd/"))
                                      (org-agenda-overriding-header "What's on my calendar")
                                      (org-agenda-span 'day)
                                      (org-agenda-start-day (org-today))
                                      (org-agenda-current-span 'day)
                                       '((:name "Today's Schedule"
                                                :scheduled t
                                                :time-grid t
                                                :deadline t
                                                :order 13)))))
                             (todo ""
                                   ((org-agenda-overriding-header "[[~/.org/gtd/][Task list]]")
                                    (org-agenda-prefix-format " %(my-agenda-prefix) ")
                                    (org-agenda-files '("~/.org/gtd/"))
                                     '((:name "CRITICAL"
                                              :priority "A"
                                              :order 1)
                                       (:name "NEXT UP"
                                              :todo "NEXT"
                                              :order 2)
                                       (:name "Emacs Reading"
                                              :and (:category "Emacs" :tag "@read")
                                              :order 3)
                                       (:name "Emacs Config"
                                              :and (:category "Emacs" :tag "@configure")
                                              :order 4)
                                       (:name "Emacs Misc"
                                              :category "Emacs"
                                              :order 5)
                                       (:name "Task Reading"
                                              :and (:category "Tasks" :tag "@read")
                                              :order 6)
                                       (:name "Task Other"
                                              :category "Tasks"
                                              :order 7)
                                       (:name "Projects"
                                              :category "Projects"
                                              :order 8)))))
                             (todo "DELEGATED"
                                   ((org-agenda-overriding-header "Delegated Tasks by WHO")
                                    (org-agenda-files '("~/.org/gtd/"))
                                     '((:auto-property "WHO")))))
                             (todo ""
                                   ((org-agenda-overriding-header "References")
                                    (org-agenda-files '("~/.org/gtd/"))
                                     '((:auto-ts t)))))))
                           ("i" "Inbox"
                            ((todo ""
                                   ((org-agenda-files '("~/.org/gtd/"))
                                    (org-agenda-overriding-header "Items in my inbox")
                                     '((:auto-ts t)))))))
                           ("x" "Get to someday"
                            ((todo ""
                                   ((org-agenda-overriding-header "Projects marked Someday")
                                    (org-agenda-files '("~/.org/gtd/"))
                                     '((:auto-ts t))))))))))
You can’t perform that action at this time.