mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
feat: improve org-capture templates
Some checks are pending
Flake check / Check flake (push) Waiting to run
Some checks are pending
Flake check / Check flake (push) Waiting to run
This commit is contained in:
parent
37686e3a1e
commit
ae2126f363
3 changed files with 819 additions and 584 deletions
|
|
@ -18902,6 +18902,22 @@ This part of the configuration mostly makes some aesthetic changes, enables neat
|
|||
|
||||
#+begin_src emacs-lisp
|
||||
|
||||
(defun swarsel/org-agenda-done-and-archive ()
|
||||
"Mark TODO at point as DONE, archive it, and save all agenda files."
|
||||
(interactive)
|
||||
(let ((org-archive-location "~/Nextcloud/Org/Archive.org::Archive"))
|
||||
(org-agenda-todo "DONE")
|
||||
(org-agenda-archive)
|
||||
(dolist (buf (buffer-list))
|
||||
(with-current-buffer buf
|
||||
(when (and buffer-file-name
|
||||
(string-prefix-p (expand-file-name "~/Nextcloud/Org/") (file-truename buffer-file-name))
|
||||
(derived-mode-p 'org-mode))
|
||||
(save-buffer))))))
|
||||
|
||||
(with-eval-after-load 'org-agenda
|
||||
(define-key org-agenda-mode-map (kbd "C-a") #'swarsel/org-agenda-done-and-archive))
|
||||
|
||||
(use-package org
|
||||
;;:diminish (org-indent-mode)
|
||||
:hook (org-mode . swarsel/org-mode-setup)
|
||||
|
|
@ -18928,11 +18944,18 @@ This part of the configuration mostly makes some aesthetic changes, enables neat
|
|||
"/home/swarsel/Nextcloud/Org/Archive.org"
|
||||
))
|
||||
|
||||
(setq org-capture-templates
|
||||
'(("t" "Todo" entry (file+headline "~/Nextcloud/Org/Tasks.org" "Inbox")
|
||||
"* TODO %?\n %i\n %a")
|
||||
("j" "Journal" entry (file+datetree "~/Nextcloud/Org/Journal.org")
|
||||
"* %?\nEntered on %U\n %i\n %a")))
|
||||
|
||||
(setq org-refile-targets
|
||||
'((swarsel-archive-org-file :maxlevel . 1)
|
||||
(swarsel-tasks-org-file :maxlevel . 1)))
|
||||
|
||||
)
|
||||
|
||||
#+end_src
|
||||
**** org-appear
|
||||
:PROPERTIES:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue