emacs.d/bundle/bundle--ct.el

97 lines
5.5 KiB
EmacsLisp
Raw Permalink Normal View History

;;; bundle--ct.el --- Bunch of capture tempates -*- lexical-binding: t; -*-
;; Copyright (C) 2024 Marcus Kammer
;; Author: Marcus Kammer <marcus.kammer@mailbox.org>
;; Keywords:
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
2024-10-11 10:34:25 +02:00
(defun mk/link-to-current-task ()
"Return an Org link to the current clocked-in task, if any, or prompt for manual entry."
(if (org-clock-is-active)
(with-current-buffer (marker-buffer org-clock-marker)
(save-excursion
(goto-char org-clock-marker)
(format ":TASK_ID: [[id:%s][%s]]" (org-id-get) (org-get-heading t t))))
(let ((manual-id (read-string "Enter Task ID (leave empty if not applicable): ")))
(unless (string-empty-p manual-id)
(format ":TASK_ID: [[id:%s][Task]]\n" manual-id)))))
(setq org-capture-templates
'(("T" "Task Management")
("Tt" "Task" entry (file "agenda/tasks.org")
"* TODO %? :TASK:\n:PROPERTIES:\n:ID: %(org-id-new)\n:Project: %^{Project}\n:END:\nEntered on %U\n")
("Tp" "Project" entry (file "agenda/projects.org")
"* %^{Project Name} :PROJECT:\n:PROPERTIES:\n:ID: %(org-id-new)\n:Start Date: %T\n:End Date: %^{End Date}\n:END:\n** Objective\n%?\n** Challenges\n- [ ] %^{Challenge 1}\n- [ ] %^{Challenge 2}\n")
("Tv" "Achievement" entry (file+olp+datetree "achievements.org")
"* %^{Achievement Title} :ACHIEVEMENT:\n:PROPERTIES:\n:Project: %^{Project}\n:Date: %T\n:END:\n- Description: %?\n- Impact: %^{Impact}\n- Associated Tasks: %^{Tasks}\n")
("N" "Notes and Journaling")
("Nn" "Note" entry (file "notes.org")
"* %? :NOTE:\n:PROPERTIES:\n:ID: %(org-id-new)\n%(mk/link-to-current-task):END:\nEntered on: %U\n")
("Nj" "Journal" entry (file+olp+datetree "agenda/journal.org")
"* %T - End of Day Reflection :JOURNAL:\n- Was ist heute gut gelaufen?\n %?\n- Was könnte verbessert werden?\n \n- Worauf konzentriere ich mich morgen?\n ")
("Nl" "Log" entry (file+olp+datetree "logbook.org")
"* %T - %^{Activity} :LOG:\n%?" :clock-in t :empty-lines 1)
("M" "Meetings and Appointments")
("Ma" "Appointment" entry (file "agenda/appt.org")
"* %^{Title} %^g\n:PROPERTIES:\n:LOCATION: %^{Location}\n:ATTENDEES: %^{Attendees}\n:END:\n%^{Date}t\n** Agenda\n%?\n** Preparation Tasks\n- [ ]\n- [ ]\n- [ ]\n** Notes\n")
("Mm" "Meeting" entry (file "agenda/meetings.org")
"* %^{Topic} \n%T\n%?" :clock-in t :empty-lines 1)
("R" "Research and Information Gathering")
("Rb" "Bookmark" table-line (file+headline "bookmarks.org" "Bookmarks")
"| %^{URL} | %^{Tags} | %u |" :prepend t)
("Rc" "Code Snippet" entry (file+headline "code.org" "Snippets")
"* %?\n#+begin_src %^{language}\n%i\n#+end_src")
("Rs" "Stock Recommendation" entry (file+headline "stocks.org" "Stock Recommendations")
"* %^{Stock Name} :STOCK:\n:PROPERTIES:\n:Date: %T\n:WKN: %^{WKN}\n:ISIN: %^{ISIN}\n:END:\n%?")
("Ru" "UTM Parameters" entry (file+headline "utm.org" "UTM Parameters")
"* %^{Campaign Name}\n:PROPERTIES:\n:Source: %^{utm_source}\n:Medium: %^{utm_medium}\n:Term: %^{utm_term}\n:Content: %^{utm_content}\n:END:\n")
("I" "Interviews")
("Ih" "How Might We" entry (file+headline "interviews.org" "HMW Questions")
"* WKW/HMW %? :HMW:\n%U\n:PROPERTIES:\n:Interviewee: %^{Interviewee}\n:Context: %^{Context}\n:END:")
("Iq" "Interview Question" entry (file+headline "interviews.org" "Interview Questions")
"* %^{Interview Topic} :INTERVIEW:\n:PROPERTIES:\n:Project: %^{Project Name}\n:Date: %T\n:END:\n- %?\n")
("Io" "Quote from User Interview" entry (file+headline "interviews.org" "Quotes")
"* %^{Quote} :QUOTE:\n:PROPERTIES:\n:Interviewee: %^{Interviewee}\n:Timestamp: %^{Timestamp in Video}\n:Project: %^{Project}\n:Context: %^{Context}\n:END:\n")
("A" "Accounting")
("Ae" "Expense" table-line (file+headline "accounting.org" "Expenses")
"| %U | %^{Amount} | %^{Category} | %? |")
("Ai" "Income" table-line (file+headline "accounting.org" "Income")
"| %U | %^{Amount} | %^{Source} | %? |")
("AI" "Invoice" table-line (file+headline "accounting.org" "Invoices")
"| %T | %^{Client} | %^{Amount} | %^{Due Date} | %? |")
("Ab" "Budget" table-line (file+headline "accounting.org" "Budget")
"| %(format-time-string \"%Y\") | %(format-time-string \"%B\") | %^{Estimated Income} | %^{Estimated Expenses} | %? |")
("Av" "Investment" table-line (file+headline "accounting.org" "Investments")
"| %U | %^{Type} | %^{Amount} | %? |")
("P" "Personal")
("Pb" "Book" table-line (file+headline "books.org" "Meine Bücherliste")
"| %^{Buchtitel} | %^{Autor} | %^{Status||Geplant|In Bearbeitung|Fertig} | %U |" :kill-buffer t)))
(provide 'bundle--ct)
;;; bundle--ct.el ends here