Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Private DOOM Emacs config highly focused around orgmode and GTD methodology, along with language support for Python and Elisp.

NotificationsYou must be signed in to change notification settings

Zyrohex/.doom.d

Repository files navigation

attachments/workspace.png

The goal of my config is to keep the configuration distraction free, and focus on functionality over looks. If you are curious to see my notes and task repo, feel free to check out ->nmartin84/org-notes. Or you can checkout my published github pages ->nmartin84.github.io.

New Changes

Copy property value to kill-ring

Often times I will need to copy a property value from a task headline, and return its contents to the kill-ring. This function will enable you to do just that.

(defunnm/return-entry-property-names ()"Returns a list of property names excluding the DEFAULT org-mode property names."  (let ((my-list (org-entry-properties))        (temp-listnil)        (discard-list '("ITEM""PRIORITY""FILE""BLOCKED")))    (dolist (i my-list) (push (car i) temp-list))    (dolist (i discard-list) (setq temp-list (remove i temp-list)))    temp-list))(nm/return-entry-property-names)(defunnm/return-entry-property-value-kill-ring ()"Returns a list of properties for the current headline and inserts the contents to the kill ring."  (interactive)  (let* ((choice (ivy-completing-read"entry:" (nm/return-entry-property-names)))        (results (org-entry-getnil choice)))    (kill-new results)    (message (format"'%s' was copied to kill-ring" results))))(map!:afterorg:map org-mode-map:leader:prefix ("z"."nicks functions"):desc"Copy property value to kill-ring""x"#'nm/return-entry-property-value-kill-ring)

Classification System

For some time now, i’ve been wanting to build a classification system for task items, to help structure context of a headline with a template of property fields that one would associate with that classifier. For example with books, when you are defining your new book organization you typically associate a book header with the following properties:Author,Subject,Year and maybe a few other things.

When you are building something like this out, it can become difficult or tideous to define those new items each time. So I have been giving some thought is a way to put a template around those items that remain original to org-mode and does not interfere.

(defunnm/return-entry-property-names ()"Returns a list of property names excluding the DEFAULT org-mode property names."  (let ((my-list (org-entry-properties))        (temp-listnil)        (discard-list '("ITEM""PRIORITY""FILE""BLOCKED")))    (dolist (i my-list) (push (car i) temp-list))    (dolist (i discard-list) (setq temp-list (remove i temp-list)))    temp-list))(nm/return-entry-property-names)(defunnm/return-entry-property-value-kill-ring ()"Returns a list of properties for the current headline and inserts the contents to the kill ring."  (interactive)  (let ((choice (ivy-completing-read"entry:" (nm/return-entry-property-names))))    (kill-new (org-entry-getnil choice))))
(defunnm/org-clarify-properties ()"Clarify properties for task."  (interactive)  (let ((my-list nm/org-clarify-templates)        (my-tempnil))    (dolist (i my-list) (push (car i) my-temp))    (dolist (i (cdr (assoc (ivy-completing-read"template:" my-temp) nm/org-clarify-templates))) (org-entry-putnil i (ivy-completing-read (format"%s:" i) (delete-dups (org-map-entries (org-entry-getnil inil)nil'file)))))))(setq nm/org-clarify-templates '(("book""AUTHOR""YEAR""SOURCE")                                 ("online""SOURCE""SITE""AUTHOR")                                 ("purchase""WHY""FUNCTION")                                 ("task""AREA")                                 ("project""GOAL""DUE")                                 ("article""SOURCE""SITE""SUBJECT")))(map!:afterorg:map org-mode-map:leader:prefix ("z"."nicks functions"):desc"Clarify Properties""c"#'nm/org-clarify-properties)(unless (ivy-completing-read"select:" '("Something"))  (error"no output"))

Bullet Journal

New capture template system that integrated the idea of a bullet journal for task and note taking.

(defunnm/capture-bullet-journal ()"Finds bullet journal headline to nest capture headline under."  (let* ((date (format-time-string"%Y-%m-%d %a")))    (goto-char (point-min))    (unless (re-search-forward (format"^*+\s%s" date)nilt)      (goto-char (point-max))      (insert (format"*%s%s" date"[/]")))))

Org-Agenda Functions for Condition checks

So another pain point has been maintaining my task items. So i’m always looking for ways to tweak or adjust how I can automate or simply task management, and my agenda setup. So this next piece adds some functions to run condition checks for tasks that are in a NEXT state, or a Inbox or waiting to be defined state.

For this piece, i’ve used bits and pieces from Doc Norang’sorg-helper.el. The idea is to mimic the GTD methodology from the org-agenda view so all aspects of it can be controled from the agenda.

(defunnm/skip-non-stuck-projects ()"Skip trees that are not stuck projects."  (save-restriction    (widen)    (let ((next-headline (save-excursion (outline-next-heading))))      (if (bh/is-project-p)          (let* ((subtree-end (org-end-of-subtreet))                 (has-next))            (save-excursion              (forward-line1)              (while (and (not has-next) (< (point) subtree-end) (and (not (bh/is-project-p)) (nm/has-next-condition)))                (unless (member (or"WAITING""SOMEDAY") (org-get-tags-at))                  (setq has-nextt))))            (if has-next                next-headlinenil))        next-headline))))
(defunnm/project-tasks-ready ()"Skip trees that are not projects"      (let ((next-headline (save-excursion (outline-next-heading)))            (subtree-end (org-end-of-subtreet)))        (if (nm/skip-non-stuck-projects)            (cond             ((and (bh/is-project-subtree-p) (nm/has-next-condition))nil)             (t subtree-end))          subtree-end)))(defunnm/has-next-condition ()"Returns t if headline has next condition state"  (save-excursion    (cond     ((nm/is-scheduled-p)t)     ((nm/exist-context-tag-p)t)     ((nm/checkbox-active-exist-p)t))))

Great, so that takes care of my project tasks that are ready to be worked, now I need something for standalone tasks.

(defunnm/standard-tasks-ready ()"Show non-project tasks. Skip project and sub-project tasks, habits, and project related tasks."  (save-restriction    (widen)    (let* ((subtree-end (save-excursion (org-end-of-subtreet)))           (next-headline (save-excursion (or (outline-next-heading) (point-max)))))      (cond       ((bh/is-project-p) next-headline)       ((bh/is-project-subtree-p) next-headline)       ((and (bh/is-task-p) (not (nm/has-next-condition))) subtree-end)       (tnil)))))

For project tasks that are stuck:

(defunnm/stuck-projects ()"Returns t when a project has no defined next actions for any of its subtasks."  (let ((next-headline (save-excursion (outline-next-heading)))        (subtree-end (org-end-of-subtreet)))    (if (or (bh/is-project-p) (bh/is-project-subtree-p))        (cond         ((and (bh/is-project-subtree-p) (not (nm/has-next-condition)))nil))      subtree-end)))

For tasks that are ready to be refiled:

(defunnm/tasks-refile ()"Returns t if the task is not part of a project and has no next state conditions."  (let* ((subtree-end (save-excursion (org-end-of-subtreet)))         (next-heading (save-excursion (outline-next-heading))))    (cond     ((nm/has-next-condition) next-heading)     ((bh/is-project-p) subtree-end))))

Capturing to a Projects Timeframe

(defunnm/capture-project-timeframes ()"Captures under the given projects timeframe headline."  (let ((p-name (ivy-completing-read"Select file:" (find-lisp-find-files"~/projects/orgmode/gtd/""\.org$")))        (h-name"* Timeframe")        (c-name (read-string"Entry name:")))    (goto-char (point-min))    (find-file p-name)    (unless (re-search-forward h-namenilt)      (progn (goto-char (point-max)) (newline) (insert"* Timeframe")))    (org-end-of-subtreet)    (newline2)    (insert (format"**%s%s" (format-time-string"[%Y-%m-%d %a %H:%M]") c-name))    (newline)))

Easy theme switcher

(setq doom-dark-themes '("doom-one""doom-solarized-dark""doom-palenight""doom-rouge""doom-spacegrey""doom-dracula""doom-vibrant""doom-city-lights""doom-moonlight""doom-horizon""doom-old-hope""doom-oceanic-next""doom-monokai-pro""doom-material""doom-henna""doom-gruvbox""doom-ephemeral""chocolate"))(setq doom-light-themes '("doom-one-light""doom-gruvbox-light""doom-solarized-light""doom-flatwhite"))(defunnm/load-dark-theme ()  (interactive)  (let* ((themes doom-dark-themes)         (first (car doom-dark-themes)))    (counsel-load-theme-action (car themes))    (setq doom-theme (car themes))    (pop doom-dark-themes)    (add-to-list'doom-dark-themes firstt)))(defunnm/load-light-theme ()  (interactive)  (let* ((themes doom-light-themes)         (first (car doom-light-themes)))    (counsel-load-theme-action (car themes))    (setq doom-theme (car themes))    (pop doom-light-themes)    (add-to-list'doom-light-themes firstt)))

Capturing Web Resources

;; This function was found on a stackoverflow post -> https://stackoverflow.com/questions/6681407/org-mode-capture-with-sexp (defunget-page-title (url)"Get title of web page, whose url can be found in the current line";; Get title of web page, with the help of functions in url.el  (with-current-buffer (url-retrieve-synchronously url);; find title by grep the html code    (goto-char0)    (re-search-forward"<title>\\([^<]*\\)</title>"nilt1)    (setq web_title_str (match-string1));; find charset by grep the html code    (goto-char0);; find the charset, assume utf-8 otherwise    (if (re-search-forward"charset=\\([-0-9a-zA-Z]*\\)"nilt1)        (setq coding_charset (downcase (match-string1)))      (setq coding_charset"utf-8");; decode the string of title.    (setq web_title_str (decode-coding-string web_title_str (intern                                                             coding_charset))))  (concat"[[" url"][" web_title_str"]]")))

Task Automation

I got tired of manually setting task states to “NEXT” “PROJ” “TODO” so i’ve added a few functions to automate this for me.

TheNEXT state will be set if any of the following 3 conditions exist:

  1. Has a scheduled date assign to the task. (NOTE: We may want to add additional checks for expired task)
  2. Task has a context task assigned. (Context tags start with “@”)
  3. Has an active checkbox that’s not marked completed.

attachments/next-states.gif
attachments/context-tags.gif

The PROJ state will become active upon the following conditions:

  1. Task has a child headline with a TODO-KEYWORD of any-type (TODO/NEXT/WAIT).

attachments/projects.gif

DEPRECATED: I need to remove this section when I can.

ID Completion

I got tired of flipping back n forth between buffers, copying the ID of a headline, then jump back and paste that ID into my link. So now i’ll haveorg-refile-get-location fetch the ID for us when I callorg-insert-link.

NOTE: I need to see a better way of caching headlines to speed-up the process

(require'find-lisp)(defunnm/org-id-prompt-id ()"Prompt for the id during completion of id: link."  (let* ((org-agenda-files (find-lisp-find-files org-directory"\.org$"))         (dest (org-refile-get-location))         (namenil)         (idnil))    (if (equal (last dest) '(nil))        (error"File contains no headlines")      (save-excursion        (find-file (cadr dest))        (goto-char (nth3 dest))        (setq id (org-id-get (point)t)              name (org-get-headingtttt)))      (org-insert-linknil (concat"id:" id) name))))(after!org (org-link-set-parameters"id":complete#'nm/org-id-prompt-id))

Quick Note Find Headline

Another pain point i’ve been constantly facing is quickly taking a note and storing it in the appropriate location without losing focus on what i’m currently working on. This is common when on calls or meetings and you need to make a note for another task item you’re working.

So with that, I added a new function tied to the quick note capture-template key, which will prompt for a headline from any of your task files that exist in “~~/projects/orgmode/gtd/~”.

(defunnm/org-end-of-headline()"Move to end of current headline"  (interactive)  (outline-next-heading)  (forward-char-1))

Daily Task Adder

This function will create a new headline, and nest the checkitem underneath the headline specified by DATE chosen during capture. This will also set a scheduled date on the headline. NOTE: I’m not real sure this is of use anymore, maybe see if we should remove it.

(defunnm/org-capture-to-task-file ()"Capture file to your default tasks file, and prompts to select a date where to file the task file to."  (let* ((child-lnil)         (parent"Checklists")         (date (org-read-date))         (heading (format"Items for")))    (goto-char (point-min));;; Locate or Create our parent headline    (unless (search-forward (format"*%s" parent)nilt)      (goto-char (point-max))      (newline)      (insert (format"*%s" parent))      (nm/org-end-of-headline))    (nm/org-end-of-headline);;; Capture outline level    (setq child-l (format"%s" (make-string (+1 (org-outline-level))?*)));;; Next we locate or create our subheading using the date string passed by the user.    (let* ((end (save-excursion (org-end-of-subtreetnil))))      (unless (re-search-forward (format"%s%s%s" child-l heading date) endt)        (newline2)        (insert (format"%s%s%s%s" child-l heading date"[/]"))))))

Orgmode Formating

Eventually this will turn into a suite of functions that will clean-up the formatting of any org-mode document, and standardize to a common format that is believed to be standardized by the community. Reddit post will come eventually to discuss, and a link will be updated in this section when that comes.

TODO: I need to start building the outline for this.

(defunnm/add-newline-between-headlines ()""  (when (equal major-mode'org-mode)    (unless (org-at-heading-p)      (org-back-to-heading))    (nm/org-end-of-headline)    (if (not (org--line-empty-p1))        (newline))))(defunnm/add-space-end-of-line ()"If N-1 at end of heading is #+end_src then insert blank character on last line."  (interactive)  (when (equal major-mode'org-mode)    (unless (org-at-heading-p)      (org-back-to-heading))    (nm/org-end-of-headline)    (next-line-1)    (if (org-looking-at-p"^#\\+end_src$")        (progn (next-line1) (insert"")))))(defunnm/newlines-between-headlines ()"Uses the org-map-entries function to scan through a buffer's   contents and ensure newlines are inserted between headlines"  (interactive)  (org-map-entries#'nm/add-newline-between-headlinest'file))(add-hook'org-insert-heading-hook#'nm/newlines-between-headlines)

Journal Capture Template

I need a way to make a dynamic template that will let me capture various types of information: meeting notes, calls, conversations, things i’m working on, etc.. Eventually this function will contain several mini templates inside of it that are called when initiated. TODO: Roll this under my new nm/find-file-or-create function.

(defunnm/capture-to-journal ()"When org-capture-template is initiated, it creates the respected headline structure."  (let ((file"~/projects/orgmode/gtd/journal.org")        (parentnil)        (childnil))    (unless (file-exists-p file)      (with-temp-buffer (write-file file)))    (find-file file)    (goto-char (point-min));; Search for headline, or else create it.    (unless (re-search-forward"* Journal"nilt)      (progn (goto-char (point-max)) (newline) (insert"* Journal")))    (unless (re-search-forward (format"**%s" (format-time-string"%b '%y")) (save-excursion (org-end-of-subtree))t)      (progn (org-end-of-subtreet) (newline) (insert (format"**%s" (format-time-string"%b '%y")))))))

Setting up my productivity layout

FIXME: I need to update this since I changed stuff around.

(defunnm/setup-productive-windows (arg1arg2)"Delete all other windows, and setup our ORGMODE production window layout."  (interactive)  (progn    (delete-other-windows)    (progn      (find-file arg1))    (progn      (split-window-right)      (evil-window-right1)      (org-agendanil"n"))    (progn      (split-window)      (evil-window-down1)      (find-file arg2)      (goto-char1)      (re-search-forward (format"*+\s\\w+\sTasks\sfor\s%s" (format-time-string"%Y-%m-%d")))      (org-tree-to-indirect-buffer))))(defunnm/productive-window ()"Setup"  (interactive)  (nm/setup-productive-windows"~/projects/orgmode/gtd/next.org""~/projects/orgmode/gtd/tasks.org"))(map!:afterorg:map org-mode-map:leader:prefix ("TAB"."workspace"):desc"Load ORGMODE Setup"","#'nm/productive-window)

Return Indirect Buffer

(defunnm/get-headlines-org-files (arg&optionalindirect)"Searches org-directory for headline and returns results to indirect buffer   ARG being a directory to search and optional INDIRECT should return t if you   want results returned to an indirect buffer."  (interactive)  (let* ((org-agenda-files (find-lisp-find-files arg"\.org$"))         (org-refile-use-outline-path'file)         (org-refile-historynil)         (dest (org-refile-get-location))         (buffernil)         (first (frame-first-window)))    (save-excursion      (if (eq first (next-window first))          (progn (evil-window-vsplit) (evil-window-right1))        (other-window1))      (find-file (cadr dest))      (goto-char (nth3 dest))      (if indirect          (org-tree-to-indirect-buffer)nil))))(defunnm/search-headlines-org-directory ()"Search the ORG-DIRECTORY, prompting user for headline and returns its results to indirect buffer."  (interactive)  (nm/get-headlines-org-files"~/projects/orgmode/"))(defunnm/search-headlines-org-tasks-directory ()"Search the GTD folder, prompting user for headline and returns its results to indirect buffer."  (interactive)  (nm/get-headlines-org-files"~/projects/orgmode/gtd/"))(map!:afterorg:map org-mode-map:leader:prefix ("s"."search"):desc"Outline Org-Directory""c"#'nm/search-headlines-org-directory:desc"Outline GTD directory""!"#'nm/search-headlines-org-tasks-directory)

Requirements

These are some items that are required outside of the normal DOOM EMACS installation, before you can use this config. The idea here is to keep this minimum so as much of this is close to regular DOOM EMACS.

  1. SQLITE3 Installation: You will need to install sqlite3, typicalled installed via your package manager assudo apt install sqlite3
  2. I use a few different monospace fonts:Input,DejaVu,FiraCode,IBM Plex Mono andRoboto Mono.

Initial-Settings

These are some of the deafult settings that I like to get out of the way. This covers some basic things like my user profile name, email address and what information I like to dispaly in the modeline.

TODO: I need to change this heading to “Hardened settings” and put in here things that typically never change.

(setq user-full-name"Nick Martin"      user-mail-address"nmartin84@gmail.com")(display-time-mode1)(setq display-time-day-and-datet)

Next up, sometimes file changes are made outside of emacs, so if we detect changes I would like emacs to refert the buffer with those new changes. Also I like to have a bit more control in my undo actions and step through each change.

(global-auto-revert-mode1)(setq undo-limit80000000      evil-want-fine-undot      auto-save-defaultnil      inhibit-compacting-font-cachest)(whitespace-mode-1)(setq-default delete-by-moving-to-trasht tab-width4 uniquify-buffer-name-style'forward window-combination-resizet x-stretch-cursornil)

Additional key bindings

(bind-key"<f6>"#'link-hint-copy-link)(bind-key"<f12>"#'org-cycle-agenda-files)(bind-key"M-."#'completion-at-point)(map!:afterorg:map org-mode-map:leader:prefix ("z"."nicks functions"):desc"completion at point""c"#'completion-at-point:desc"Review Fleeting Notes""r"#'nm/review-fleeting-notes:desc"Find File in ORGMODE""f"#'nm/find-files-orgmode:desc" File project""p"#'nm/find-projects:prefix ("s"."+search"):desc"Occur""."#'occur:desc"Outline""o"#'counsel-outline:desc"Counsel ripgrep""d"#'counsel-rg:desc"Swiper All""@"#'swiper-all:prefix ("l"."+links")"."#'org-next-link","#'org-previous-link"o"#'org-open-at-point"g"#'eos/org-add-ids-to-headlines-in-file)(map!:after org-agenda:map org-agenda-mode-map:localleader:desc"Filter""f"#'org-agenda-filter)(defunnm/review-fleeting-notes ()  (interactive)  (nm/find-file-cleaned-up"~/projects/orgmode/fleeting/"))(defunnm/find-files-orgmode ()  (interactive)  (nm/find-file-cleaned-up org-directory))(defunnm/find-projects ()  (interactive)  (nm/find-file-cleaned-up"~/projects/orgmode/gtd/projects/"))

If I ever use terminal mode, these are some settings i’ll want to set to increase the quality of life when working from my terminal window.

(when (equal (window-system)nil)  (and   (bind-key"C-<down>"#'+org/insert-item-below);(setq doom-theme nil)   (setq doom-font (font-spec:family"Roboto Mono":size20))))

Now I add my default folders and files that I want emacs/org-mode to use:

(setq diary-file"~/projects/orgmode/diary.org")(setq org-directory"~/projects/orgmode/")(setq projectile-project-search-path"~/projects/")

Next we configure popup-rules and default fonts.

(after!org (set-popup-rule!"^\\*lsp-help":side'bottom:size.30:selectt)  (set-popup-rule!"*helm*":side'right:size.30:selectt)  (set-popup-rule!"*Org QL View:*":side'right:size.25:selectt)  (set-popup-rule!"*Org Note*":side'bottom:size.35:selectt)  (set-popup-rule!"*Capture*":side'left:size.30:selectt)  (set-popup-rule!"*Python:ob-ipython-py*":side'right:size.25:selectt)  (set-popup-rule!"*eww*":side'right:size.30:selectt)  (set-popup-rule!"*CAPTURE-*":side'left:size.30:selectt));(set-popup-rule! "*Org Agenda*" :side 'right :size .35 :select t))(setq inhibit-compacting-font-cachest)(setq doom-font (font-spec:family"IBM Plex Mono":size24:weight'light)      doom-big-font (font-spec:family"IBM Plex Mono":size26:weight'light)      doom-variable-pitch-font (font-spec:family"IBM Plex Mono":weight'regular:size20)      doom-serif-font (font-spec:family"IBM Plex Mono":weight'light))(when (equal window-system'x) (toggle-frame-fullscreen))(after!org  (custom-set-faces!    '(org-level-1:height1.15:inheritoutline-1)    '(org-level-2:height1.13:inheritoutline-2)    '(org-level-3:height1.11:inheritoutline-3)    '(org-level-4:height1.09:inheritoutline-4)    '(org-level-5:height1.07:inheritoutline-5)    '(org-level-6:height1.05:inheritoutline-6)    '(org-level-7:height1.03:inheritoutline-7)    '(org-level-8:height1.01:inheritoutline-8)))(after!org  (custom-set-faces!    '(org-document-title:height1.15)));; (when (equal system-type 'gnu/linux);;   (setq doom-font (font-spec :family "JetBrains Mono" :size 20 :weight 'normal);;         doom-big-font (font-spec :family "JetBrains Mono" :size 22 :weight 'normal)));; (when (equal system-type 'windows-nt);;   (setq doom-font (font-spec :family "InputMono" :size 18);;         doom-big-font (font-spec :family "InputMono" :size 22)))

Org-Mode

Here we add any requirements before org-mode starts to load. Some key notes here to make note of:

  1. org-image-actual-width will use the function to try and set the image size to a % of your display’s width.
  2. hl-todo-mode enabled for ORGMODE. All of my notes are stored under my parent org-directory along with my GTD tasks, but I don’t necesarily like to add tasks to my notes files, or see them appear in my org-agenda. So instead I add the keywords where I need to make a note, or something I need to follow-up on and use the magit-todos-list to see what follow-up items I have to complete. HACK: See if we can modify hl-todo keywords just for ORGMODE.

NOTE [2021-01-03 Sun] - i’m going to try swapping log notes going after drawers to see how I like it…

(require'org-habit)(require'org-id)(require'org-checklist)(after!org (setq org-archive-location"~/projects/orgmode/gtd/archives.org::* %s";org-image-actual-width (truncate (* (display-pixel-width) 0.15))                  org-link-file-path-type'relative                  org-log-state-notes-insert-after-drawerst                  org-catch-invisible-edits'error                  org-refile-targets '((nil:maxlevel.9)                                       (org-agenda-files:maxlevel.4))                  org-refile-use-outline-path'buffer-name                  org-refile-use-cachenil                  org-outline-path-complete-in-stepsnil                  org-refile-allow-creating-parent-nodes'confirm                  org-startup-indented'indent                  org-insert-heading-respect-contentt                  org-startup-folded'content                  org-src-tab-acts-nativelyt                  org-list-allow-alphabeticalnil))(add-hook'org-mode-hook'auto-fill-mode);(add-hook 'org-mode-hook 'hl-todo-mode)(add-hook'org-mode-hook (lambda () (display-line-numbers-mode-1)))(setq org-attach-directory (concat org-directory".attach/"))

Is there a way to prevent auto-fill from breaking links?

Agenda

First we setup a few deafults for the org-agenda buffer:

(setq org-agenda-todo-ignore-schedulednil      org-agenda-tags-todo-honor-ignore-optionst      org-agenda-fontify-prioritiest)

This first stage is how I track what’s on my list of things to complete.

(setq org-agenda-custom-commandsnil)(push '("o""overview"        ((agenda""                 ((org-agenda-span'1)                  (org-agenda-overriding-header" Agenda")                  (org-agenda-files (append (file-expand-wildcards"~/projects/orgmode/gtd/*.org")))                  (org-agenda-start-day (org-today))))         (tags-todo"-@delegated-someday/+NEXT"                    ((org-agenda-overriding-header" Next Tasks")                     (org-agenda-todo-ignore-scheduledt)                     (org-agenda-todo-ignore-deadlinest)                     (org-agenda-todo-ignore-with-datet)                     (org-tags-match-list-sublevels'indented)                     (org-agenda-sorting-strategy                      '(category-up))))         (tags-todo"-@delegated-someday/+DOING"                    ((org-agenda-overriding-header" Doing")                     (org-agenda-todo-ignore-scheduledt)                     (org-agenda-todo-ignore-deadlinest)                     (org-agenda-todo-ignore-with-datet)                     (org-tags-match-list-sublevels'indented)                     (org-agenda-sorting-strategy                      '(category-up))))         (tags-todo"@errands-someday/!-REFILE-NEXT-DOING"                    ((org-agenda-overriding-header" Errands")                     (org-agenda-todo-ignore-scheduledt)                     (org-agenda-todo-ignore-deadlinest)                     (org-agenda-todo-ignore-with-datet)                     (org-tags-match-list-sublevels'indented)                     (org-agenda-sorting-strategy                      '(category-up))))         (tags-todo"@home-someday/!-REFILE-NEXT-DOING"                    ((org-agenda-overriding-header" Home")                     (org-agenda-todo-ignore-scheduledt)                     (org-agenda-todo-ignore-deadlinest)                     (org-agenda-todo-ignore-with-datet)                     (org-tags-match-list-sublevels'indented)                     (org-agenda-sorting-strategy                      '(category-up))))         (tags-todo"@computer-someday/!-REFILE-NEXT-DOING"                    ((org-agenda-overriding-header" Computer")                     (org-agenda-todo-ignore-scheduledt)                     (org-agenda-todo-ignore-deadlinest)                     (org-agenda-todo-ignore-with-datet)                     (org-tags-match-list-sublevels'indented)                     (org-agenda-sorting-strategy                      '(category-up))))         (tags-todo"-{^@\\w+}-someday/-NEXT-REFILE-READ-DOING"                    ((org-agenda-overriding-header" Other Tasks")                     (org-agenda-todo-ignore-scheduledt)                     (org-agenda-todo-ignore-deadlinest)                     (org-agenda-todo-ignore-with-datet)                     (org-tags-match-list-sublevels'indented)                     (org-agenda-sorting-strategy                      '(category-up))))         (tags-todo"-someday/+REFILE"                    ((org-agenda-overriding-header" Inbox"))))) org-agenda-custom-commands)(push '("gh""@home" tags-todo"@home/-REFILE") org-agenda-custom-commands)(push '("ge""@errands" tags-todo"@errands/-REFILE") org-agenda-custom-commands)(push '("gc""@computer" tags-todo"@computer/-REFILE") org-agenda-custom-commands)(push '("gr""@read" tags-todo"@read/-REFILE") org-agenda-custom-commands)(push '("gd""doing" todo"+DOING") org-agenda-custom-commands)(push '("gn""next" todo"+NEXT") org-agenda-custom-commands)(push '("go""other tasks" tags-todo"-{^@\\w+}-goals/-NEXT-REFILE-DOING" ((org-agenda-todo-ignore-with-datet))) org-agenda-custom-commands)(push '("gg""goals" tags-todo"goals/" ((org-agenda-todo-ignore-with-datet))) org-agenda-custom-commands)(push '("gi"" inbox" todo"REFILE") org-agenda-custom-commands)(push '("l""literature"        ((tags-todo"/!"         ((org-agenda-todo-ignore-scheduledt)          (org-agenda-todo-ignore-with-datet)          (org-agenda-todo-ignore-deadlinest)          (org-agenda-todo-ignore-with-datet)          (org-agenda-files (append (find-lisp-find-files"~/projects/orgmode/literature/""\.org$")))          (org-tags-match-list-sublevels'indented))))) org-agenda-custom-commands)(push '("r""review"        ((tags-todo"-{^@\\w+}/-REFILE"         ((org-agenda-todo-ignore-scheduledt)          (org-agenda-todo-ignore-with-datet)          (org-agenda-todo-ignore-deadlinest)          (org-agenda-todo-ignore-with-datet))))) org-agenda-custom-commands)(push '("b""bullet"        ((agenda""                 ((org-agenda-span'2)                  (org-agenda-files (append (file-expand-wildcards"~/projects/orgmode/bullet/*.org")))                  (org-agenda-start-day (org-today))))         (tags-todo"-someday/"                    ((org-agenda-overriding-header"Task Items")                     (org-agenda-files (append (file-expand-wildcards"~/projects/orgmode/bullet/*.org")))                     (org-agenda-todo-ignore-scheduledt)                     (org-agenda-todo-ignore-deadlinest)                     (org-agenda-todo-ignore-with-datet)))         (tags"note"               ((org-agenda-overriding-header"Notes")                (org-agenda-files (append (file-expand-wildcards"~/projects/orgmode/bullet/*.org"))))))) org-agenda-custom-commands)

Capture Templates

attachments/capture-templates.png

What templates do I need available for quick capture of information?

  1. Checklists
  2. Bullet Journal
  3. Journal
  4. Notes
  5. Web Resources

Task items can be a few different things, and there’s the whole GTD which i’m trying my bestest to follow. Sometimes I may have a task item that I simply need to remind myself to complete, and just need to check it off a list acknowledging i’ve completed it and other times I need an actual task item to capture and track data in.

(setq org-capture-templates '(("g"" gtd")                              ("gp"" projects")                              ("b"" bullet journal")                              ("l"" local project")                              ("n"" notes")                              ("r"" resources")))(push '("gpt"" task" entry (function nm/find-project-task)"* REFILE %^{task}\n%?":empty-lines-before1:empty-lines-after1) org-capture-templates)(push '("gpr"" define requirements" item (function nm/find-project-requirement)"":empty-lines-before1:empty-lines-after1) org-capture-templates)(push '("gpn"" note" entry (function nm/find-project-note)"*":empty-lines-before1:empty-lines-after1) org-capture-templates)(push '("gpf"" timeframe" entry (function nm/find-project-timeframe)"* %^{timeframe entry} [%<%Y-%m-%d %a %H:%M>]\n:PROPERTIES:\n:CREATED: %U\n:END:\n%?":empty-lines-before1:empty-lines-after1) org-capture-templates);; TODO: Cleanup the template names to be more clear and easier to recognize.(push '("ga"" append to headline" plain (function nm/org-capture-log)" *Note added:* [%<%Y-%m-%d %a %H:%M>]\n%?":empty-lines-before1:empty-lines-after1) org-capture-templates)(push '("gc"" capture" entry (file+olp"~/projects/orgmode/gtd/tasks.org""Inbox")"* REFILE %^{task}\n:PROPERTIES:\n:CREATED: %U\n:END:\n:METADATA:\n- SOURCE:\n- AUTHOR:\n:END:\n%?") org-capture-templates)(push '("gk"" capture [kill-ring]" entry (file+olp"~/projects/orgmode/gtd/tasks.org""Inbox")"* REFILE %^{task}\n:PROPERTIES:\n:CREATED: %U\n:END:\n%c") org-capture-templates)(push '("gx"" capture [current pos]" entry (file+olp"~/projects/orgmode/gtd/tasks.org""Inbox")"* REFILE %^{task}\n:PROPERTIES:\n:CREATED: %U\n:END:\nLocation at time of capture: %a") org-capture-templates)(defunnm/prompt-during-capture ()"Prompt and ask for metadata properties during capture."  (interactive)  (when (y-or-n-p"add schedule?")    (insert (format"SCHEDULED: <%s>"(org-read-date)))));; TODO: I need to finish implementing the bullet-journal.(push '("bt"" bullet task" entry (file+function"~/projects/orgmode/gtd/bullet.org" nm/capture-bullet-journal)"* REFILE %^{task} %^g\n:PROPERTIES:\n:CREATED: %U\n:END:\n":empty-lines-before1:empty-lines-after1) org-capture-templates)(push '("nj"" journal" entry (function nm/capture-to-journal)"* %^{entry}\n:PROPERTIES:\n:CREATED: %U\n:END:\n%?") org-capture-templates)(push '("nn"" new reference [excluded from org-roam]" plain (function nm/create-notes-file)"%?":unnarrowedt:empty-lines-before1:empty-lines-after1) org-capture-templates)(push '("nr"" roam article" plain (function nm/create-roam-file)"%?":unnarrowedt) org-capture-templates);; TODO: Configure more resource capture templates.(push '("rr"" research literature" entry (file+function"~/projects/orgmode/gtd/websources.org" nm/enter-headline-websources)"* READ %(get-page-title (current-kill 0))") org-capture-templates)(push '("rf"" rss feed" entry (file+function"~/projects/orgmode/elfeed.org" nm/return-headline-in-file)"* %^{link}") org-capture-templates)
;; This function is used in conjuction with the capture template "new note" which will find or generate a note based off the folder and filename.(defunnm/create-notes-file ()"Function for creating a notes file under org-capture-templates."  (nm/find-file-or-createt"~/projects/orgmode/references/""note"))(defunnm/create-roam-file ()"Function to create a new roam notes file, while prompting for folder location."  (nm/find-file-or-createt org-directory"note"))(defunnm/find-project-task ()"Function for creating a project file under org-capture-templates."  (nm/find-file-or-createt"~/projects/orgmode/gtd/projects""project""Tasks")  (setq org-agenda-files (append (file-expand-wildcards"~/projects/orgmode/gtd/*.org") (file-expand-wildcards"~/projects/orgmode/gtd/*/*.org"))))(defunnm/find-project-timeframe ()"Function for creating a project file under org-capture-templates."  (nm/find-file-or-createt"~/projects/orgmode/gtd/projects""project""Timeframe"))(defunnm/find-project-requirement ()"Function for creating a project file under org-capture-templates."  (nm/find-file-or-createt"~/projects/orgmode/gtd/projects""project""Requirements"))(defunnm/find-project-note ()"Function for creating a project file under org-capture-templates."  (nm/find-file-or-createt"~/projects/orgmode/gtd/projects""project""Notes"))(defunnm/return-headline-in-file ()"Returns the headline position."  (let* ((org-agenda-files"~/projects/orgmode/elfeed.org")         (location (nth3 (org-refile-get-locationnilnil'confirm))))    (goto-char location)    (org-end-of-line)))(defunnm/find-project-todo ()"When in projectile path, finds root todo.org file"  (let ((path (doom-project-root))        (file"todo.org"))    (find-file (format"%s%s" path file))))(defunnm/enter-headline-websources ()"This is a simple function for the purposes when using org-capture to add my entries to a custom Headline, and if URL is not in clipboard it'll return an error and cancel the capture process."  (let* ((file"~/projects/orgmode/gtd/websources.org")         (headline (read-string"Headline?")))    (progn      (nm/check-headline-exist file headline)      (goto-char (point-min))      (re-search-forward (format"^\*+\s%s" (upcase headline))))))(defunnm/check-headline-exist (file-argheadline-arg)"This function will check if HEADLINE-ARG exists in FILE-ARG, and if not it creates the headline."  (save-excursion (find-file file-arg) (goto-char (point-min))                  (unless (re-search-forward (format"*%s" (upcase headline-arg))nilt)                    (goto-char (point-max)) (insert (format"*%s" (upcase headline-arg))) (org-set-property"CATEGORY" (downcase headline-arg))))t)(defunnm/org-capture-log ()"Initiate the capture system and find headline to capture under."  (let* ((org-agenda-files (find-lisp-find-files"~/projects/orgmode/gtd/""\.org$"))         (dest (org-refile-get-location))         (file (cadr dest))         (pos (nth3 dest))         (title (nth2 dest)))    (find-file file)    (goto-char pos)    (nm/org-end-of-headline)))

Clock Settings

(after!org (setq org-clock-continuouslyt)); Will fill in gaps between the last and current clocked-in task.

Default Tags

I don’t like to shift my eyes back n forth when i’m scanning data, so I keep my columns one space after the headline.

(setq org-tags-column0)

I like to keep a list of predefined context tags, this helps speed the assignment process up and also keep things consistent.

(setq org-tag-alist '(("@home".?h)                      ("@computer".?c)                      ("@errands")                      ("@read")                      ("@delegated")                      ("someday")))

Export Settings

(after!org (setq org-html-head-include-scriptst                  org-export-with-toct                  org-export-with-authort                  org-export-headline-levels4                  org-export-with-drawersnil                  org-export-with-emailt                  org-export-with-footnotest                  org-export-with-sub-superscriptsnil                  org-export-with-latext                  org-export-with-section-numbersnil                  org-export-with-propertiesnil                  org-export-with-smart-quotest                  org-export-backends '(pdf ascii html latex odt md pandoc)))

Embed images into the exported HTML files.

(defunreplace-in-string (whatwithin)  (replace-regexp-in-string (regexp-quote what) with innil'literal))(defunorg-html--format-image (sourceattributesinfo)  (progn    (setqsource (replace-in-string"%20"""source))    (format"<img src=\"data:image/%s;base64,%s\"%s />"            (or (file-name-extensionsource)"")            (base64-encode-string             (with-temp-buffer               (insert-file-contents-literallysource)              (buffer-string)))            (file-name-nondirectorysource))))

Keywords

After much feedback and discussing with other users, I decided to simplify the keyword list to make it simple. Defining a project will now focus on the tag word:project: so that all child task are treated as part of the project.

KeywordDescription
\TODOTask has actionable items defined and ready to be worked.
HOLDHas actionable items, but is on hold due to various reasons.
NEXTIs ready to be worked and should be worked on soon.
DONETask is completed and closed.
KILLAbandoned or terminated.
(custom-declare-face'+org-todo-next '((t (:inherit (boldfont-lock-constant-faceorg-todo))))"")(custom-declare-face'+org-todo-project '((t (:inherit (boldfont-lock-doc-faceorg-todo))))"")(custom-declare-face'+org-todo-onhold  '((t (:inherit (boldwarningorg-todo))))"")(custom-declare-face'+org-todo-next '((t (:inherit (boldfont-lock-keyword-faceorg-todo))))"")(custom-declare-face'org-checkbox-statistics-todo '((t (:inherit (boldfont-lock-constant-faceorg-todo))))"")  (setq org-todo-keywords        '((sequence"REFILE(r)""TODO(t)""NEXT(n)""DOING(o)""WAIT(w)""|""DONE(d)""KILL(k)")          (sequence"PROJ(p)""|""COMPLETE""CANCELED"))        org-todo-keyword-faces        '(("WAIT". +org-todo-onhold)          ("DOING". +org-todo-active)          ("NEXT". +org-todo-next)          ("REFILE". +org-todo-onhold)          ("PROJ". +org-todo-next)          ("TODO". +org-todo-active)))

Loading agenda settings

(after!org (setq org-agenda-diary-file"~/projects/orgmode/diary.org"                  org-agenda-dim-blocked-tasksnil; This has funny behavior, similar to checkbox dependencies.                  org-agenda-use-time-gridnil                  org-agenda-tags-column0                  org-agenda-hide-tags-regexp"^w+"; Hides tags in agenda-view                  org-agenda-compact-blocksnil                  org-agenda-block-separator""                  org-agenda-skip-scheduled-if-donet                  org-agenda-skip-deadline-if-donet                  org-agenda-window-setup'current-window                  org-enforce-todo-checkbox-dependenciesnil; This has funny behavior, when t and you try changing a value on the parent task, it can lead to Emacs freezing up. TODO See if we can fix the freezing behavior when making changes in org-agenda-mode.                  org-enforce-todo-dependenciest                  org-habit-show-habitst))(after!org (setq org-agenda-files (append (file-expand-wildcards"~/projects/orgmode/gtd/*.org") (file-expand-wildcards"~/projects/orgmode/gtd/*/*.org"))))

Logging and Drawers

Next, we like to keep a history of our activity of a task so wetrack when changes occur, and we also keep our notes logged intheir own drawer. Optionally you can also add the following in-buffer settings to override theorg-log-into-drawer function.#+STARTUP: logdrawer or#+STARTUP: nologdrawer

(after!org (setq org-log-into-drawert                  org-log-done'time                  org-log-repeat'time                  org-log-redeadline'note                  org-log-reschedule'note))

Looks and Feels

Here we change some of the things how org-mode looks and feels, some options available are:

  • org-ellipsis"▼, ↴, ⬎, ⤷,…, and ⋱."
  • org-superstar-headline-bullets-list"◉" "●" "○" "∴" "•"
(after!org (setq org-hide-emphasis-markerst                  org-hide-leading-starst                  org-list-demote-modify-bullet '(("+"."-") ("1."."a.") ("-"."+"))))(when (require'org-superstarnil'noerror)  (setq org-superstar-headline-bullets-list '("")        org-superstar-item-bullet-alistnil))(when (require'org-fancy-prioritiesnil'noerror)  (setq org-fancy-priorities-list '("""""")))

Properties

I like to have properties inherited from their parent.

(after!org (setq org-use-property-inheritancet))

Publishing

REVIEW do we need to re-define our publish settings for the ROAM directory?

(after!org (setq org-publish-project-alist                  '(("attachments":base-directory"~/projects/orgmode/":recursivet:base-extension"jpg\\|jpeg\\|png\\|pdf\\|css\\|svg":publishing-directory"~/projects/nmartin84.github.io":publishing-function org-publish-attachment)                    ("notes":base-directory"~/projects/orgmode/":base-extension"org":publishing-directory"~/projects/nmartin84.github.io":section-numbersnil:with-propertiesnil:with-drawersnil:with-timestamps active:with-creatort:with-emailt:with-toct:recursivet:exclude"gtd/secrets.org|gtd/journal.org":headline-levels8:auto-sitemapt:sitemap-filename"index.html":publishing-function org-html-publish-to-html:html-head"<link rel=\"stylesheet\" href=\"https://raw.githack.com/nmartin84/html-style-sheets/master/notes.css\" type=\"text/css\"/>":html-link-up"../":html-link-up"../../index.html":auto-preamblet)                    ("myprojectweb":components("attachments""notes")))))

Modules

Org-Appear is a cool package that’ll auto show emphasis markers when your cursor is on a element enclosed in emphasis.

(add-hook'org-mode-hook'org-appear-mode)(setq org-appear-autolinksnil)

company mode

;(setq company-backends '(company-capf))(set-company-backend!'org-mode '(company-yasnippet company-capf company-files company-elisp))(set-company-backend!'emacs-lisp-mode '(company-yasnippet company-elisp))(setq company-idle-delay0.25      company-minimum-prefix-length2)(add-to-list'company-backends '(company-capf company-files company-yasnippet company-semantic company-bbdb company-cmake company-keywords))

Deadgrep

(map!:map deadgrep-mode-map"o"#'deadgrep-visit-result-other-window)

DEFT

When this variable is set tot your deft directory will be updated to your projectile-project root’s folder when switching projects, and the deft buffer’s contents will be refreshed.

Configuring DEFT default settings

(use-package deft:bind (("<f8>". deft)):commands (deft deft-open-file deft-new-file-named):config  (setq deft-directory"~/projects/orgmode/"        deft-auto-save-interval0        deft-recursivet        deft-current-sort-method'title        deft-extensions '("md""txt""org")        deft-use-filter-string-for-filenamet        deft-use-filename-as-titlenil        deft-markdown-mode-title-level1        deft-file-naming-rules '((nospace."-"))))(defunmy-deft/strip-quotes (str)  (cond ((string-match"\"\\(.+\\)\"" str) (match-string1 str))        ((string-match"'\\(.+\\)'" str) (match-string1 str))        (t str)))(defunmy-deft/parse-title-from-front-matter-data (str)  (if (string-match"^title:\\(.+\\)" str)      (let* ((title-text (my-deft/strip-quotes (match-string1 str)))             (is-draft (string-match"^draft: true" str)))        (concat (if is-draft"[DRAFT]""") title-text))))(defunmy-deft/deft-file-relative-directory (filename)  (file-name-directory (file-relative-name filename deft-directory)))(defunmy-deft/title-prefix-from-file-name (filename)  (let ((reldir (my-deft/deft-file-relative-directory filename)))    (if reldir        (concat (directory-file-name reldir)" >"))))(defunmy-deft/parse-title-with-directory-prepended (orig&restargs)  (let ((str (nth1 args))        (filename (car args)))    (concat      (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))            nondir          (if (string-prefix-p"---\n" str)              (my-deft/parse-title-from-front-matter-data               (car (split-string (substring str4)"\n---\n")))            (apply orig args)))))))(provide'my-deft-title)(advice-add'deft-parse-title:around#'my-deft/parse-title-with-directory-prepended)

Elfeed

(use-package elfeed-org:defer:config  (setq rmh-elfeed-org-files (list"~/projects/orgmode/elfeed.org")))(use-package elfeed:defer:config  (setq elfeed-db-directory"~/.elfeed/"))(require'elfeed-org)(elfeed-org)(setq elfeed-db-directory"~/.elfeed/")(setq rmh-elfeed-org-files (list"~/.elfeed/elfeed.org"))

Graphs and Chart Modules

Eventually I would like to have org-mind-map generating charts like Sacha’sevil-plans.

(after!org (setq org-ditaa-jar-path"~/.emacs.d/.local/straight/repos/org-mode/contrib/scripts/ditaa.jar"))(use-package gnuplot:defer:config  (setq gnuplot-program"gnuplot")); MERMAID(use-package mermaid-mode:defer:config  (setq mermaid-mmdc-location"~/node_modules/.bin/mmdc"        ob-mermaid-cli-path"~/node_modules/.bin/mmdc")); PLANTUML(use-package ob-plantuml:ensurenil:commands  (org-babel-execute:plantuml):defer:config  (setq plantuml-jar-path (expand-file-name"~/.doom.d/plantuml.jar")))

Hugo

(setq hugo_base_dir"~/projects/braindump/")

Journal

(after!org (setq org-journal-dir"~/projects/orgmode/gtd/journal/"                  org-journal-enable-agenda-integrationt                  org-journal-file-type'monthly                  org-journal-carryover-items"TODO=\"TODO\"|TODO=\"NEXT\"|TODO=\"PROJ\"|TODO=\"STRT\"|TODO=\"WAIT\"|TODO=\"HOLD\""))

Magit Mode

A touch of magit to make it a little more special.

(add-to-list'magit-todos-keywords-list"NOTE")

Noter

(setq org-noter-notes-search-path (concat org-directory"literature/"))

Pandoc

(setq org-pandoc-options '((standalone.t) (self-contained.t)))

Reveal

(when (require'ox-revealnil'noerror)  (setq org-reveal-root"https://cdn.jsdelivr.net/npm/reveal.js")  (setq org-reveal-title-slidenil))

ROAM

These are my default ROAM settings

(when (require'org-roamnil'noerror)  (setq org-roam-tag-sources '(prop all-directories))  (setq org-roam-db-location"~/projects/orgmode/roam.db")  (setq org-roam-directory"~/projects/orgmode/")  (setq org-roam-buffer-position'right)  (setq org-roam-link-file-path-type'relative)  (setq org-roam-file-exclude-regexp"references/*\\|gtd/*\\|elfeed.org\\|README.org")  (setq org-roam-completion-everywheret);; Configuration of daily templates  (setq org-roam-dailies-capture-templates      '(("d""daily" plain (function org-roam-capture--get-point)"":immediate-finisht:file-name"journal/%<%Y-%m-%d-%a>":head"#+TITLE: %<%Y-%m-%d %a>\n#+STARTUP: content\n\n")))  (setq org-roam-capture-templates        '(("l""literature" plain (function org-roam-capture--get-point):file-name"literature/%<%Y%m%d%H%M>-${slug}":head"#+title: ${title}\n#+author: %(concat user-full-name)\n#+email: %(concat user-mail-address)\n#+created: %(format-time-string\"[%Y-%m-%d %H:%M]\")\n#+roam_tags: %^{roam_tags}\n\nsource:\n\n%?":unnarrowedt)          ("f""fleeting" plain (function org-roam-capture--get-point):file-name"fleeting/%<%Y%m%d%H%M>-${slug}":head"#+title: ${title}\n#+author: %(concat user-full-name)\n#+email: %(concat user-mail-address)\n#+created: %(format-time-string\"[%Y-%m-%d %H:%M]\")\n#+roam_tags:\n\n%?":unnarrowedt)          ("p""Permanent (prompt folder)" plain (function org-roam-capture--get-point):file-name"%(read-directory-name\"directory:\" org-directory)/%<%Y%m%d%H%M>-${slug}":head"#+title: ${title}\n#+author: %(concat user-full-name)\n#+email: %(concat user-mail-address)\n#+created: %(format-time-string\"[%Y-%m-%d %H:%M]\")\n#+roam_tags:\n\n%?":unnarrowedt)))  (push '("x""Projects" plain (function org-roam-capture--get-point):file-name"gtd/projects/%<%Y%m%d%H%M>-${slug}":head"#+title: ${title}\n#+roam_tags: %^{tags}\n\n%?":unnarrowedt) org-roam-capture-templates))(defunnm/org-roam-prompt-tags ()"Prompt user and ask if they want to input roam_tags during capture."  (when (y-or-n-p"Add tags?")    (insert (format"%s""\n#+roam_tags:"))))

ROAM Server

(when (require'org-roam-servernil'noerror)  (use-package org-roam-server:ensuret:config    (setq org-roam-server-host"192.168.1.249"          org-roam-server-port8060          org-roam-server-export-inline-imagest          org-roam-server-authenticatenil          org-roam-server-network-pollt          org-roam-server-network-vis-options"{\"layout\": {\"randomSeed\": false },\"physics\": {\"stabilization\": {\"iterations\": 10000,\"fit\": false,\"updateInterval\": 10000 },\"barnesHut\": {\"gravitationalConstant\": -4000,\"avoidOverlap\": 1,\"springConstant\": 0.02,\"springLength\": 95 } } }"          org-roam-server-network-arrowsnil          org-roam-server-serve-filest          org-roam-server-extra-node-options (list (cons'shape"dot") (cons'opacity1))          org-roam-server-network-label-truncatet          org-roam-server-network-label-truncate-length40          org-roam-server-network-label-wrap-length20)))

Look into abbrev-mode

Custom Functions

(load!"org-helpers.el")(defunnm/task-is-active-proj ()"Checks if task is a Project with child subtask"  (and (bh/is-project-p)       (nm/has-subtask-active-p)))(defunnm/task-is-stuck-proj ()"Checks if task is a Project with child subtask"  (and (bh/is-project-p)       (not (nm/has-subtask-active-p))))(defunnm/has-subtask-active-p ()"Returns t for any heading that has subtasks."  (save-restriction    (widen)    (org-back-to-headingt)    (let ((end (save-excursion (org-end-of-subtreet))))      (outline-end-of-heading)      (save-excursion        (re-search-forward (concat"^\*+""\\(NEXT\\|DOING\\)") endt)))))(defunnm/update-task-conditions ()"Update task states depending on their conditions."  (interactive)  (org-map-entries (lambda ()                     (when (nm/task-is-active-proj) (org-todo"ACTIVE"))                     (when (nm/task-is-stuck-proj) (org-todo"PENDING")))t))(add-hook'before-save-hook#'nm/update-task-conditions)(defunnm/find-file-cleaned-up (folder)"Returns a list of filenames, in a cleaned up format and easy to read. FOLDER will   be your folder path to search for."  (interactive)  (let* ((files (find-lisp-find-files folder".org$"))         (files-alistnil)         (file-namesnil))    (dolist (ifiles) (push (cons i (capitalize (replace-regexp-in-string"[-_]""" (replace-regexp-in-string"^[0-9]+-\\|.org$""" (file-name-nondirectory i))))) files-alist))    (dolist (i files-alist) (push (cdr i) file-names))    (let* ((choice (ivy-completing-read"select:" file-names)))      (if (equal choice"")nil        (find-file (car (rassoc choice files-alist)))))))(defunnm/convert-filename-format (&optionaltime-pfolder-path)"Prompts user for filename and directory, and returns the value in a cleaned up format.   If TIME-P is t, then includes date+time stamp in filename, FOLDER-PATH is the folder   location to search for files."  (let* ((file (replace-in-string"""-" (downcase (read-file-name"select file:" (if folder-path (concat folder-path) org-directory))))))    (if (file-exists-p file)        (concat file)      (if (s-ends-with?".org" file)          (concat (format"%s%s" (file-name-directory file) (if time-p (concat (format-time-string"%Y%m%d%H%M%S-") (file-name-nondirectory (downcase file)))                                                              (concat (file-name-nondirectory (downcase file))))))        (concat (format"%s%s.org" (file-name-directory file) (if time-p (concat (format-time-string"%Y%m%d%H%M%S-") (file-name-nondirectory (downcase file)))                                                                (concat (file-name-nondirectory (downcase file))))))))))(defunnm/find-file-or-create (time-pfolder-path&optionaltypeheader)"Creates a new file, if TYPE is set to NOTE then also insert file-template."  (interactive)  (let* ((file (nm/convert-filename-format time-p folder-path)));; TODO: Add condition when filename is passed in as argument to skip this piece.    (if (file-exists-p file)        (find-file file)      (when (equal"note" type) (find-file file)            (insert (format"%s\n%s\n%s\n\n"                            (downcase (format"#+title:%s" (replace-in-string"-""" (replace-regexp-in-string"[0-9]+-""" (replace-in-string".org""" (file-name-nondirectory file))))))                            (downcase (concat"#+author:" user-full-name))                            (downcase (concat"#+email:" user-mail-address)))))      (when (equal"project" type) (find-file file)            (insert (format"%s\n%s\n%s\n\n* Requirements\n\n* Timeframe\n\n* Notes\n\n* Tasks\n"                            (downcase (format"#+title:%s" (replace-in-string"-""" (replace-regexp-in-string"[0-9]+-""" (replace-in-string".org""" (file-name-nondirectory file))))))                            (downcase (concat"#+author:" user-full-name ))                            (downcase (concat"#+email:" user-mail-address)))))      (when (equalnil type) (find-file)));; If user passes in header argument, search for it and if the search fails to find the header, create it.    (if header (unless (progn (goto-char (point-min)) (re-search-forward (format"^*+%s" header)))                 (goto-char (point-max))                 (newline)                 (insert (format"*%s" header))                 (newline)))))

Archive keeping Structure

(defadviceorg-archive-subtree (around fix-hierarchy activate)  (let* ((fix-archive-p (and (not current-prefix-arg)                             (not (use-region-p))))         (location (org-archive--compute-location org-archive-location))         (afile (car location))         (offset (if (=0 (length (cdr location)))1                   (1+ (string-match"[^*]" (cdr location)))))         (buffer (or (find-buffer-visiting afile) (find-file-noselect afile))))    ad-do-it    (when fix-archive-p      (with-current-buffer buffer        (goto-char (point-max))        (while (> (org-current-level) offset) (org-up-heading-safe))        (let* ((olpath (org-entry-get (point)"ARCHIVE_OLPATH"))               (path (and olpath (split-string olpath"/")))               (level offset)               tree-text)          (when olpath            (org-mark-subtree)            (setq tree-text (buffer-substring (region-beginning) (region-end)))            (let (this-command) (org-cut-subtree))            (goto-char (point-min))            (save-restriction              (widen)              (-each path                (lambda (heading)                  (if (re-search-forward                       (rx-to-string                        `(: bol (repeat,level"*") (1+""),heading))nilt)                      (org-narrow-to-subtree)                    (goto-char (point-max))                    (unless (looking-at"^")                      (insert"\n"))                    (insert (make-string level?*)""                            heading"\n"))                  (cl-incf level)))              (widen)              (org-end-of-subtreett)              (org-paste-subtree level tree-text))))))))

Custom Faces

TODO: Consider moving to extras.org if we are not using it.

;; (defface org-logbook-note;;   '((t (:foreground "LightSkyBlue")));;   "Face for printr function");; (custom-set-faces!;;   '(org-roam-block-link :weight "bold"));; (font-lock-add-keywords 'org-mode '(("\\[\\[\\[\\[.+\\]\\[.+\\]\\]\\]\\]" . 'org-roam-block-link)))

Clarify Tasks

TODO: I need to either figure something out for this, or move it to extra.org

Clarify task will take a list of property fields and pass them tonm/org-clarify-task-properties to update task items which are missing those property fields.

(defunnm/org-get-headline-property (arg)"Extract property from headline and return results."  (interactive)  (org-entry-getnil argt))(defunnm/org-get-headline-properties ()"Get headline properties for ARG."  (org-back-to-heading)  (org-element-at-point))(defunnm/org-get-headline-title ()"Get headline title from current headline."  (interactive)  (org-element-property:title (nm/org-get-headline-properties)));;;;;;;;;;;;--------[ Clarify Task Properties ]----------;;;;;;;;;;;;;(defunnm/org-clarify-metadata ()"Runs the clarify-task-metadata function with ARG being a list of property values."; TODO work on this function and add some meaning to it.  (interactive)  (nm/org-clarify-task-properties org-tasks-properties-metadata))(map!:afterorg:map org-mode-map:localleader:prefix ("j"."nicks functions"):desc"Clarify properties""c"#'nm/org-clarify-metadata)
(defunnm/emacs-change-font ()"Change font based on available font list."  (interactive)  (let ((font (ivy-completing-read"font:" nm/font-family-list))        (size (ivy-completing-read"size:" '("16""18""20""22""24""26""28""30")))        (weight (ivy-completing-read"weight:" '(normal lightbold extra-light ultra-light semi-light extra-bold ultra-bold)))        (width (ivy-completing-read"width:" '(normal condensed expanded ultra-condensed extra-condensed semi-condensed semi-expanded extra-expanded ultra-expanded))))    (setq doom-font (font-spec:family font:size (string-to-number size):weight (intern weight):width (intern width))          doom-big-font (font-spec:family font:size (+2 (string-to-number size)):weight (intern weight):width (intern width))))  (doom/reload-font))(defvarnm/font-family-list '("JetBrains Mono""Roboto Mono""VictorMono Nerd Font Mono""Fira Code""Hack""Input Mono""Anonymous Pro""Cousine""PT Mono""DejaVu Sans Mono""Victor Mono""Liberation Mono"))

End of file loading

Load secrets from here…

(let ((secrets (expand-file-name"secrets.el" doom-private-dir)))  (when (file-exists-p secrets)    (load secrets)))

Local Variables

About

Private DOOM Emacs config highly focused around orgmode and GTD methodology, along with language support for Python and Elisp.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp