config/doom: add handy org todo functions

This commit is contained in:
xerus2000 2021-03-30 20:29:08 +02:00
parent bc46d7be86
commit e7dc791b98
3 changed files with 19 additions and 10 deletions

View File

@ -129,10 +129,14 @@
'("1-projects" "2-standards" "3-resources") '("1-projects" "2-standards" "3-resources")
))) )))
(defun org-todo-or-insert (&optional arg)
(interactive "P")
(if (org-at-heading-p) (org-todo arg) (org-insert-todo-heading arg t)))
(defun org-timestamp-up-week () (defun org-timestamp-up-week ()
(interactive) (interactive)
(setq current-prefix-arg '(7)) (let ((setq current-prefix-arg '(7))) (call-interactively 'org-timestamp-up-day))
(call-interactively 'org-timestamp-up-day)) )
(map! :map org-mode-map (map! :map org-mode-map
:localleader :localleader
@ -173,6 +177,14 @@
; try to fold up elsewhere ; try to fold up elsewhere
(ct/org-foldup))) (ct/org-foldup)))
(define-key org-mode-map (kbd "S-<tab>") 'ct/org-shifttab) (define-key org-mode-map (kbd "S-<tab>") 'ct/org-shifttab)
;; https://emacs.stackexchange.com/questions/38529/make-multiple-lines-todos-at-once-in-org-mode
(defun org-todo-region ()
(interactive)
(let ((scope (if mark-active 'region 'tree))
(state (org-fast-todo-selection))
(org-enforce-todo-dependencies nil))
(org-map-entries (lambda () (org-todo state)) nil scope)))
) )
;; Behavior ;; Behavior
@ -206,11 +218,6 @@
;(after! org ;(after! org
; (add-to-list 'org-file-apps '(system . "setsid -w xdg-open %s")) ; (add-to-list 'org-file-apps '(system . "setsid -w xdg-open %s"))
;;; Org-todos
(defun org-todo-or-insert (&optional arg)
(interactive "P")
(if (org-at-heading-p) (org-todo arg) (org-insert-todo-heading arg)))
;; Automated logging for todos - https://stackoverflow.com/questions/12262220/add-created-date-property-to-todos-in-org-mode/52815573#52815573 ;; Automated logging for todos - https://stackoverflow.com/questions/12262220/add-created-date-property-to-todos-in-org-mode/52815573#52815573
(setq org-log-done 'time) (setq org-log-done 'time)
(setq org-log-into-drawer t) (setq org-log-into-drawer t)

View File

@ -111,8 +111,9 @@
cp = cherry-pick cp = cherry-pick
rb = rebase rb = rebase
rbm = !git rebase $(git main) rbi = rebase --interactive
rbc = rebase --continue rbc = rebase --continue
rbm = !git rebase $(git main)
sta = stash sta = stash
stl = !git --no-pager stash list stl = !git --no-pager stash list

View File

@ -4,11 +4,12 @@
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported. # absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/.local/desktop" XDG_DESKTOP_DIR="$HOME/.local/desktop"
XDG_TEMPLATES_DIR="$HOME/.local/templates" XDG_TEMPLATES_DIR="$HOME/.local/templates"
XDG_DOWNLOAD_DIR="$HOME/data/4-incubator/downloads" XDG_DOWNLOAD_DIR="$HOME/data/4-incubator/downloads"
XDG_MUSIC_DIR="$HOME/data/music" XDG_MUSIC_DIR="$HOME/data/music"
XDG_PICTURES_DIR="$HOME/data/images" XDG_PICTURES_DIR="$HOME/data/images"
XDG_VIDEOS_DIR="$HOME/data/videos" XDG_VIDEOS_DIR="$HOME/"
XDG_DOCUMENTS_DIR="$HOME/data/3-resources/documents" XDG_DOCUMENTS_DIR="$HOME/data/3-resources/documents"
XDG_PUBLICSHARE_DIR="$HOME/data/share" XDG_PUBLICSHARE_DIR="$HOME/"