Template Docs + Konfiguration

This commit is contained in:
knedlik
2026-04-08 21:12:07 +02:00
parent 0e49835736
commit f0f19590ca
7 changed files with 41 additions and 73 deletions

View File

@@ -53,6 +53,12 @@
(setq s (replace-regexp-in-string "\\`-\\|-\\'" "" s))
s))
(defun my/org-new-id ()
"Erzeuge eine neue Org-ID."
(org-id-new))
(defun my/org-ensure-directory (dir)
(make-directory dir t)
dir)
@@ -81,24 +87,26 @@
(let ((my/org-capture-title title))
(org-capture nil key)))))
;; ===== Commands =====
(defun my/org-capture-new-task ()
(defun my/org-new-task ()
(interactive)
(let ((title (read-string "Task-Titel: ")))
(my/org-open-or-capture title "n" #'my/org-task-file-from-title)))
(defun my/org-capture-new-doc ()
(defun my/org-new-doc ()
(interactive)
(let ((title (read-string "Doku-Titel: ")))
(my/org-open-or-capture title "d" #'my/org-doc-file-from-title)))
(defun my/org-capture-new-kpi ()
(defun my/org-new-kpi ()
(interactive)
(let ((title (read-string "KPI-Titel: ")))
(my/org-open-or-capture title "k" #'my/org-doc-file-from-title)))
(defun my/org-capture-new-note ()
(defun my/org-new-note ()
(interactive)
(find-file (my/org-today-file))
(when (= (point-max) 1)
@@ -118,11 +126,11 @@
:unnarrowed t
:jump-to-captured t)
("d" "Neue Doku-Datei" plain
("d" "Neue Docs-Datei" plain
(file
(lambda ()
(my/org-doc-file-from-title my/org-capture-title)))
"#+title: %(or my/org-capture-title \"\")\n#+category: Docs\n\n:PROPERTIES:\n:ART: Analyse\n:END:\n\n* Überblick\n%?\n\n* Details\n\n* Referenzen\n"
(file "~/.emacs.d/templates/org/docs-template.org")
:unnarrowed t
:jump-to-captured t)
@@ -131,13 +139,15 @@
(file
(lambda ()
(my/org-doc-file-from-title my/org-capture-title)))
"#+title: %(or my/org-capture-title \"\")\n#+category: Docs\n\n:PROPERTIES:\n:ART: KPI-Steckbrief\n:VERANTWORTLICH: %^{Verantwortlich}\n:BEREICH: %^{Bereich}\n:END:\n\n* Definition\n%?\n\n* Berechnung\n#+begin_src sql\n\n#+end_src\n\n* Datenquelle\n\n* Interpretation\n\n* Hinweise\n"
(file "~/.emacs.d/templates/org/kpi-steckbrief-template.org")
;; "#+title: %(or my/org-capture-title \"\")\n#+category: Docs\n\n:PROPERTIES:\n:ART: KPI-Steckbrief\n:VERANTWORTLICH: %^{Verantwortlich}\n:BEREICH: %^{Bereich}\n:END:\n\n* Definition\n%?\n\n* Berechnung\n#+begin_src sql\n\n#+end_src\n\n* Datenquelle\n\n* Interpretation\n\n* Hinweise\n"
:unnarrowed t
:jump-to-captured t)))
;; ===== Agenda =====
(setq org-agenda-files '("~/org/todos/" "~/org/docs/"))
(setq org-agenda-files '("~/org/todos/"))
(provide 'init-capture)
;;; init-capture.el ends here