update settings, costumize org-capture and roam capture. etc.

This commit is contained in:
cho 2023-09-05 20:34:18 +07:00
parent e01793f1bf
commit a83355aa32

View File

@ -22,7 +22,9 @@
;; accept. For example:
;;
(setq doom-variable-pitch-font (font-spec :family "Libertinus Serif" :size 13))
;;(setq doom-variable-pitch-font (font-spec :family "DejaVu Serif" :size 13))
;;
;; If you or Emacs can't find your font, use 'M-x describe-font' to look them
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to
;; refresh your font settings. If Emacs still can't find your font, it likely
@ -35,6 +37,7 @@
;(setq doom-theme 'doom-one)
;(setq doom-theme 'doom-wilmersdorf)
;(setq doom-theme 'doom-plain-dark)
;(setq doom-theme 'doom-feather-dark)
;(setq doom-theme 'doom-plain)
;(setq doom-theme 'doom-flatwhite)
@ -80,13 +83,15 @@
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.
(after! org
;;; agenda files
(setq org-agenda-files '("~/housekeeping/calendar.org"
"~/notebook/ag/"
"~/notebook/refile.org"))
"~/notebook/refile.org"
"~/notebook/notes/events/birthdays.org"))
(after! org
(setq org-log-done 'time)
(use-package! org-journal
@ -134,12 +139,137 @@
(setq org-wild-notifier-keyword-whitelist nil))
(setq org-wild-notifier-keyword-blacklist '("DONE"))
;; org-roam configurations
(use-package! org-roam
:ensure t
:custom
(setq org-roam-directory "~/notebook/roam/")
:config
(org-roam-setup))
(setq org-roam-capture-templates
'(("d" "default" plain "%?"
:target (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
"#+title: ${title}\n")
:unnarrowed t)
;; main things
("l" "literature" plain "%?"
:if-new
(file+head "literature/%<%Y%m%d%H%M%S>-${title}.org" "#+title: ${title}\n")
:immediate-finish t
:unnarrowed t)
("p" "permanent" plain "%?"
:if-new
(file+head "permanent/%<%Y%m%d%H%M%S>-${title}.org" "#+title: ${title}\n")
:immediate-finish t
:unnarrowed t)
("f" "fleeting" plain "%?"
:if-new
(file+head "fleeting/%<%Y%m%d%H%M%S>-${title}.org" "#+title: ${title}\n")
:immediate-finish t
:unnarrowed t)
;; other categories
("r" "reference" plain "%?"
:if-new
(file+head "reference/%<%Y%m%d%H%M%S>-${title}.org" "#+title: ${title}\n")
:immediate-finish t
:unnarrowed t)
("a" "article" plain "%?"
:if-new
(file+head "articles/%<%Y%m%d%H%M%S>-${title}.org" "#+title: ${title}\n#+filetags: :article:\n")
:immediate-finish t
:unnarrowed t)))
;(cl-defmethod org-roam-node-type ((node org-roam-node))
; "Return the TYPE of NODE."
; (condition-case nil
; (file-name-nondirectory
; (directory-file-name
; (file-name-directory
; (file-relative-name (org-roam-node-file node) org-roam-directory))))
; (error "")))
;(setq org-roam-node-display-template
; (concat "${type:15} ${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
;;; org-capture stuff
(setq +org-capture-todo-file "ag/todo.org")
;; this sets Personal notes to refile instead
(defvar +org-capture-refile-file "refile.org")
(setq +org-capture-refile-file
(expand-file-name +org-capture-refile-file org-directory))
;(add-to-list 'org-capture-templates
; '(("s" "Slipbox" entry (file "braindump/org/inbox.org")
; "* %?\n")
; ("t" "Personal todo" entry
; (file+headline +org-capture-todo-file "Inbox")
; "* [ ] %?\n%i\n%a" :prepend t)
; )
(setq org-capture-templates
'(("t" "Personal todo" entry
(file+headline +org-capture-todo-file "todo")
"* [ ] %?\n%i\n%a")
("T" "Personal todo (single)" entry
(file+headline +org-capture-todo-file "todo")
"* [ ] %?\n")
("n" "Personal notes" entry
(file +org-capture-refile-file)
"* %u %?\n%i\n%a" :prepend t)
;; using org-journal atm..
;("j" "Journal" entry
;(file+olp+datetree +org-capture-journal-file)
;"* %U %?\n%i\n%a" :prepend t)
;; Will use {project-root}/{todo,notes,changelog}.org, unless a
;; {todo,notes,changelog}.org file is found in a parent directory.
;; Uses the basename from `+org-capture-todo-file',
;; `+org-capture-changelog-file' and `+org-capture-notes-file'.
("p" "Templates for projects")
("pt" "Project-local todo" entry ; {project-root}/todo.org
(file+headline +org-capture-project-todo-file "Inbox")
"* TODO %?\n%i\n%a" :prepend t)
("pn" "Project-local notes" entry ; {project-root}/notes.org
(file+headline +org-capture-project-notes-file "Inbox")
"* %U %?\n%i\n%a" :prepend t)
("pc" "Project-local changelog" entry ; {project-root}/changelog.org
(file+headline +org-capture-project-changelog-file "Unreleased")
"* %U %?\n%i\n%a" :prepend t)
;; Will use {org-directory}/{+org-capture-projects-file} and store
;; these under {ProjectName}/{Tasks,Notes,Changelog} headings. They
;; support `:parents' to specify what headings to put them under, e.g.
;; :parents ("Projects")
("o" "Centralized templates for projects")
("ot" "Project todo" entry
(function +org-capture-central-project-todo-file)
"* TODO %?\n %i\n %a"
:heading "Tasks"
:prepend nil)
("on" "Project notes" entry
(function +org-capture-central-project-notes-file)
"* %U %?\n %i\n %a"
:heading "Notes"
:prepend t)
("oc" "Project changelog" entry
(function +org-capture-central-project-changelog-file)
"* %U %?\n %i\n %a"
:heading "Changelog"
:prepend t)
;; org books / general logging
("b" "Book log" item (function org-books-visit-book-log)
"- %U %?" :prepend t)
;; zettelkasten
("s" "Slipbox" entry (file "roam/inbox.org")
"* %?\n")))
)
;;; end of (!after org ...
@ -178,3 +308,12 @@
(let ((org-agenda-tag-filter-preset '("-habits")))
(org-agenda arg "a")))
(bind-key "<f5>" 'agenda/hide-daily-schedule-1)
;;; termux specific
;(setq browse-url-browser-function 'browse-url-generic
; browse-url-generic-program "termux-open")
(defun jethro/org-archive-done-tasks ()
"Archive all done tasks."
(interactive)
(org-map-entries 'org-archive-subtree "/DONE" 'file))