dotfiles/dot_config/emacs/lisp/init-org.el

122 lines
4.6 KiB
EmacsLisp

;;; org-mode.el --- org-mode customizations -*- lexical-binding: t -*-
;; Author: Andrew Scott <git at andyscott dot me>
;; Keywords: org, convenience, tools
;; URL: https://codeberg.org/andyscott/dotfiles
;; This file is not part of GNU Emacs
;; Copyright (c) 2024 Andrew Scott
;; MIT No Attribution
;; Permission is hereby granted, free of charge, to any person obtaining a copy of this
;; software and associated documentation files (the "Software"), to deal in the Software
;; without restriction, including without limitation the rights to use, copy, modify,
;; merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
;; permit persons to whom the Software is furnished to do so.
;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
;; INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
;; PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
;; OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
;;; Commentary:
;; My org-mode customizations.
;;; Code:
(use-package org
:bind
(:map global-map
("C-c a" . org-agenda)
("C-c c" . org-capture)
("C-c l" . org-store-link))
:config
(setopt org-agenda-files (directory-files-recursively org-directory "org$")
org-agenda-skip-deadline-if-done t
org-agenda-skip-scheduled-if-done t
org-agenda-start-on-weekday nil
org-archive-location (concat org-directory "/archive.org::* From %s")
org-blank-before-new-entry '((heading . auto)
(plain-list-item . auto))
org-enforce-todo-dependencies t
org-fontify-quote-and-verse-blocks t
org-hide-emphasis-markers t
org-log-done 'time
org-refile-targets '((nil :maxlevel . 2)
(org-agenda-files :maxlevel . 2))
org-refile-use-outline-path 'file
org-return-follows-link t
org-src-preserve-indentation t
org-startup-folded 'content
org-todo-keywords '((sequence "BLOCKED(b@/!)" "IN-PROGRESS(i@/!)"
"TODO(t)" "WAITING(i@/!)" "|" "DONE(d!)"
"WONT-DO(w@/!)"))
org-todo-keyword-faces '(("TODO" . (icon-button))
("IN-PROGRESS" . (tool-bar))
("BLOCKED" . (match))
("WONT-DO" . (org-done))))
(setq org-capture-templates
`(
("m" "Personal")
("mj" "Log Entry"
entry (file+datetree ,(concat org-directory "/personal_log.org"))
"** %?"
:empty-lines 1)
("mn" "Note"
entry (file+headline ,(concat org-directory "/notes.org") "Note to self...")
"** %?"
:empty-lines 1)
("mt" "Todo"
entry (file+headline ,(concat org-directory "/inbox.org") "You can do it!")
"** TODO [#B] %?\n:Created: %U\nSCHEDULED: %^{SCHEDULED: }T\n "
:empty-lines 1)
("p" "Projects")
("pn" "Note"
entry (file+headline ,(concat org-directory "/notes.org") "Project Notes")
"** %?"
:empty-lines 1)
("pt" "Todo"
entry (file+headline ,(concat org-directory "/inbox.org") "Project Tasks")
"** TODO [#B] %?\n:Created: %U\nSCHEDULED: %^{SCHEDULED: }T\n%i\n%a\nNotes: "
:empty-lines 1)
("w" "Work")
("wn" "Note"
entry (file+headline ,(concat org-directory "/notes.org") "Work Notes")
"** %?"
:empty-lines 1)
("wt" "Todo"
entry (file+headline ,(concat org-directory "/inbox.org") "Work Tasks")
"** TODO [#B] %?\n:Created: %U\nSCHEDULED: %^{SCHEDULED: }T\n%i\n%a\nNotes: "
:empty-lines 1)))
:hook (org-mode . org-indent-mode)
:init
(setopt org-directory "~/Nextcloud/Documents/org")
(bind-keys :prefix-map as/org-prefix-map
:prefix "C-c o"
("n" . org-priority-down)
("p" . org-priority-up)
("f" . org-shiftmetaright)
("b" . org-shiftmetaleft)))
(use-package org-timeblock
:bind
(:map as/org-prefix-map
("t" . org-timeblock))
:config
(setopt org-timeblock-new-task-time 'pick
org-timeblock-show-future-repeats 'next
org-timeblock-span 3))
(provide 'init-org)
;;; org-mode.el ends here