From 90608c53e32281754eac9312544469bdd37cda34 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Wed, 1 Sep 2021 21:58:52 +0200 Subject: [PATCH] [Spacemacs] Move org capture templates out of main config Use org capture templates out of my main config so they can be shared between my Spacemacs config and my vanilla config --- org/capture/birthday.orgcaptmpl | 2 + org/capture/email.orgcaptmpl | 16 ++ org/capture/event.orgcaptmpl | 3 + org/capture/health.orgcaptmpl | 4 + org/capture/informatique.orgcaptmpl | 6 + org/capture/journal.orgcaptmpl | 2 + org/capture/link.orgcaptmpl | 6 + org/capture/notes-quote.orgcaptmpl | 10 + org/capture/notes.orgcaptmpl | 5 + org/capture/protocol-link.orgcaptmpl | 7 + org/capture/protocol.orgcaptmpl | 11 + org/capture/resource.orgcaptmpl | 6 + org/capture/youtube.orgcaptmpl | 7 + org/config/spacemacs.org | 292 +-------------------------- 14 files changed, 93 insertions(+), 284 deletions(-) create mode 100644 org/capture/birthday.orgcaptmpl create mode 100644 org/capture/email.orgcaptmpl create mode 100644 org/capture/event.orgcaptmpl create mode 100644 org/capture/health.orgcaptmpl create mode 100644 org/capture/informatique.orgcaptmpl create mode 100644 org/capture/journal.orgcaptmpl create mode 100644 org/capture/link.orgcaptmpl create mode 100644 org/capture/notes-quote.orgcaptmpl create mode 100644 org/capture/notes.orgcaptmpl create mode 100644 org/capture/protocol-link.orgcaptmpl create mode 100644 org/capture/protocol.orgcaptmpl create mode 100644 org/capture/resource.orgcaptmpl create mode 100644 org/capture/youtube.orgcaptmpl diff --git a/org/capture/birthday.orgcaptmpl b/org/capture/birthday.orgcaptmpl new file mode 100644 index 0000000..06561f7 --- /dev/null +++ b/org/capture/birthday.orgcaptmpl @@ -0,0 +1,2 @@ +* %^{Name} +SCHEDULED: %^t diff --git a/org/capture/email.orgcaptmpl b/org/capture/email.orgcaptmpl new file mode 100644 index 0000000..de472b7 --- /dev/null +++ b/org/capture/email.orgcaptmpl @@ -0,0 +1,16 @@ +** TODO [#A] Write Email +SCHEDULED: %^t +:PROPERTIES: +:CAPTURED: %U +:END: +From: Lucien Cartier-Tilet +To: %^{Recipient} +Subject: %^{Object} +--text follows this line-- +%? +-- +Lucien “Phundrak” Cartier-Tilet +https://phundrak.com (Français) +https://en.phundrak.com (English) + +Sent from a Free and Open-Source Linux operating system with GNU/Emacs diff --git a/org/capture/event.orgcaptmpl b/org/capture/event.orgcaptmpl new file mode 100644 index 0000000..ce98066 --- /dev/null +++ b/org/capture/event.orgcaptmpl @@ -0,0 +1,3 @@ +* %^{Title} +%^{Scheduled or deadline?||SCHEDULED||DEADLINE}: %^t +%? diff --git a/org/capture/health.orgcaptmpl b/org/capture/health.orgcaptmpl new file mode 100644 index 0000000..3253443 --- /dev/null +++ b/org/capture/health.orgcaptmpl @@ -0,0 +1,4 @@ +* %^{Title} +SCHEDULED: %^t + +%? diff --git a/org/capture/informatique.orgcaptmpl b/org/capture/informatique.orgcaptmpl new file mode 100644 index 0000000..4b4c674 --- /dev/null +++ b/org/capture/informatique.orgcaptmpl @@ -0,0 +1,6 @@ +* TODO %^{Title} +%^{Scheduled or Deadline?||SCHEDULED||DEADLINE}: %^t +:PROPERTIES: +:CATEGORY: %^{Category} +:END: +%? diff --git a/org/capture/journal.orgcaptmpl b/org/capture/journal.orgcaptmpl new file mode 100644 index 0000000..b14f3f6 --- /dev/null +++ b/org/capture/journal.orgcaptmpl @@ -0,0 +1,2 @@ +* %U %^{Title} +%? diff --git a/org/capture/link.orgcaptmpl b/org/capture/link.orgcaptmpl new file mode 100644 index 0000000..73c3464 --- /dev/null +++ b/org/capture/link.orgcaptmpl @@ -0,0 +1,6 @@ +* TODO [#C] %^{Title} +:PROPERTIES: +:CAPTURED: %U +:LINK: %^{Link} +:END: +%? diff --git a/org/capture/notes-quote.orgcaptmpl b/org/capture/notes-quote.orgcaptmpl new file mode 100644 index 0000000..ebd4229 --- /dev/null +++ b/org/capture/notes-quote.orgcaptmpl @@ -0,0 +1,10 @@ +* %^{Title} +:PROPERTIES: +:CAPTURED: %U +:END: +Possible inspiration: +#+begin_quote +%i +#+end_quote + +%? diff --git a/org/capture/notes.orgcaptmpl b/org/capture/notes.orgcaptmpl new file mode 100644 index 0000000..281e965 --- /dev/null +++ b/org/capture/notes.orgcaptmpl @@ -0,0 +1,5 @@ +* %^{Title} +:PROPERTIES: +:CAPTURED: %U +:END: +%? diff --git a/org/capture/protocol-link.orgcaptmpl b/org/capture/protocol-link.orgcaptmpl new file mode 100644 index 0000000..a45cbcd --- /dev/null +++ b/org/capture/protocol-link.orgcaptmpl @@ -0,0 +1,7 @@ +* TODO [#C] Link: %^{Title} +:PROPERTIES: +:CAPTURED: %U +:LINK: %:link +:TITLE: %:description +:END: +%? diff --git a/org/capture/protocol.orgcaptmpl b/org/capture/protocol.orgcaptmpl new file mode 100644 index 0000000..6a21d4d --- /dev/null +++ b/org/capture/protocol.orgcaptmpl @@ -0,0 +1,11 @@ +* TODO [#C] %^{Title} +:PROPERTIES: +:CAPTURED: %U +:LINK: %:link +:TITLE: %:description +:END: +#+begin_quote +%i +#+end_quote + +%? diff --git a/org/capture/resource.orgcaptmpl b/org/capture/resource.orgcaptmpl new file mode 100644 index 0000000..73c3464 --- /dev/null +++ b/org/capture/resource.orgcaptmpl @@ -0,0 +1,6 @@ +* TODO [#C] %^{Title} +:PROPERTIES: +:CAPTURED: %U +:LINK: %^{Link} +:END: +%? diff --git a/org/capture/youtube.orgcaptmpl b/org/capture/youtube.orgcaptmpl new file mode 100644 index 0000000..b347b73 --- /dev/null +++ b/org/capture/youtube.orgcaptmpl @@ -0,0 +1,7 @@ +* TODO [#C] %^{Title} +:PROPERTIES: +:CAPTURED: %U +:AUTHOR: %^{Author} +:LINK: %^{Link} +:END: +%? diff --git a/org/config/spacemacs.org b/org/config/spacemacs.org index 94810ac..12d6047 100644 --- a/org/config/spacemacs.org +++ b/org/config/spacemacs.org @@ -1916,10 +1916,10 @@ Cairo. The function definition was taken [[https://github.com/caiohcs/my-emacs#s :END: This function comes directly from Xah Lee’s website and allows the user to sort files in a dired buffer depending on four factors: - * File name - * File size - * Last modification date - * File extension + - File name + - File size + - Last modification date + - File extension #+BEGIN_SRC emacs-lisp (defun xah/dired-sort () "Sort dired dir listing in different ways. Prompt for a choice. @@ -2803,47 +2803,6 @@ one of them.

Screenshot of an org-mode buffer

#+end_export -And here you can find the source code of this buffer you just saw a screenshot -of: -#+BEGIN_SRC org :exports code - ,#+TITLE: My Document - ,#+AUTHOR: Lucien Cartier-Tilet - ,#+EMAIL: lucien@phundrak.com - ,#+DATE: 2020-12-21 - ,#+TAGS: tag1|tag2|tag3 - ,* Header 1 - :PROPERTIES: - :CUSTOM_ID: custom-id-for-html-export - :END: - # A regular comment - This is an example org file, with [[https://config.phundrak.com/emacs][a link]], a {{{macro(with arguments)}}}, an <>, /text in italic/, __undelined__, *bold*, +striken through+, some ~code~ and =verbatim=, some^{superscript} and_{subscript}, a code block and a bullet list: - ,* Element 1 - ,* Element 2 - ,#+header :export code - ,#+BEGIN_SRC emacs-lisp - (message "Hello World!") - ,#+END_SRC - | / | | | < | - | This | is | a | table | - |------+---------+----------+-------| - | With | various | elements | | - ,** TODO Global task [1/2] - ,*** TODO [#A] Task 1 - ,*** TODO Checkboxes [1/3] - - [ ] Checkbox 1 - - [X] Checkbox 2 - - [ ] Checkbox 3 - ,*** DONE Task 2 - CLOSED: [2020-12-21 mon. 14:30] - ,** Header 2 - ,*** Header 3 - ,**** Header 4 - ,***** Header 5 - ,****** Header 6 - ,******* Header 7 - ,******** Header 8 -#+END_SRC - In order to make org-mode even sexier, let’s enable ~variable-pitch-mode~ for org-mode so we can get some proportional font. I’ll also remove ~auto-fill-mode~ which seems to stick to Orgmode like hell and I don’t know why. @@ -3203,32 +3162,7 @@ is exported to another format the header disappears but its content stays. (ox-extras-activate '(ignore-headlines)) #+END_SRC This gives us access to the ~:ignore:~ tag which allows the behavior above -mentioned. To give you an idea, the org buffer -#+BEGIN_SRC org - ,* Headline 1 - Blah - - ,** Headline 2 - Blah - - ,*** Hidden headline 3-1 :ignore: - Blabla - - ,*** Hidden headline 3-2 :ignore: - Blahblah -#+END_SRC -Will be exported as if it were the buffer -#+BEGIN_SRC org - ,* Headline 1 - Blah - - ,** Headline 2 - Blah - - Blabla - - Blahblah -#+END_SRC +mentioned. **** Capture :PROPERTIES: @@ -3404,219 +3338,9 @@ but in external files which can be modified freely as actual Org buffers instead of trying to get a proper one with loads of ~\n~ characters and such. All these templates are declared below. -In the next sub-sections will be described my org capture templates. These are -not tangled into my Emacs configuration files, but into separate ~.orgcaptmpl~ -files stored into =~/org/capture/=. - -***** Emails -:PROPERTIES: -:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Emails-d87336fe -:END: -This is my template for a new Email: -#+BEGIN_SRC org :tangle ~/org/capture/email.orgcaptmpl - ,** TODO [#A] Write Email - SCHEDULED: %^t - :PROPERTIES: - :CAPTURED: %U - :END: - From: Lucien Cartier-Tilet - To: %^{Recipient} - Subject: %^{Object} - --text follows this line-- - %? - -- - Lucien “Phundrak” Cartier-Tilet - https://phundrak.com (Français) - https://en.phundrak.com (English) - - Sent from a Free and Open-Source Linux operating system with GNU/Emacs -#+END_SRC - -I use it in case my computer is not yet connected to the internet and I need to -already write the email so I can send it later. All I will need to to afterwards -will be to copy and paste my capture in a new message buffer and send it once I -am back online. This is exported to =~/org/capture/email.orgcaptmpl=. - -***** Journal -:PROPERTIES: -:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Journal-9916f9bf -:END: -This template is quite simple: it creates a new entry with the current timestamp -as its title, a brief title of my choosing, and then I can write whatever I wish -to write. This is exported to =~/org/capture/journal.orgcaptmpl=. -#+BEGIN_SRC org :tangle ~/org/capture/journal.orgcaptmpl - ,* %U %^{Title} - %? -#+END_SRC - -***** Notes -:PROPERTIES: -:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Notes-4b4c10aa -:END: -This template is used for taking note about various subjects that can go from -conlanging to development. I wrote it so I can know from where this capture was -made and when, and it even supports text that was highlighted in Emacs that will -be inserted in a quote block. This is exported to -=~/org/capture/notes.orgcaptmpl=. -#+BEGIN_SRC org :tangle ~/org/capture/notes.orgcaptmpl - ,* %^{Title} - :PROPERTIES: - :CAPTURED: %U - :END: - %? -#+END_SRC - -#+BEGIN_SRC org :tangle ~/org/capture/notes-quote.orgcaptmpl - ,* %^{Title} - :PROPERTIES: - :CAPTURED: %U - :END: - Possible inspiration: - ,#+begin_quote - %i - ,#+end_quote - - %? -#+END_SRC - -***** Protocol -:PROPERTIES: -:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Protocol-ec45ec49 -:END: -This capture is used when received through org-protocol, with the Org-protocol -Extension for Firefox. It allows me to save in a quote block what I’ve -highlighted, as well as the link of the webpage on which my saved content was -highlighted. This file is exported to =~/org/capture/protocol.orgcaptmpl=. -#+BEGIN_SRC org :tangle ~/org/capture/protocol.orgcaptmpl - ,* TODO [#C] %^{Title} - :PROPERTIES: - :CAPTURED: %U - :LINK: %:link - :TITLE: %:description - :END: - ,#+begin_quote - %i - ,#+end_quote - - %? -#+END_SRC - -This next capture template is used only when a link is sent to Emacs and no -content was highlighted. -#+BEGIN_SRC org :tangle ~/org/capture/protocol-link.orgcaptmpl - ,* TODO [#C] Link: %^{Title} - :PROPERTIES: - :CAPTURED: %U - :LINK: %:link - :TITLE: %:description - :END: - %? -#+END_SRC - -***** Resources -:PROPERTIES: -:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Resources-b23bfbd0 -:END: -This is the default template for resources, which generally are located on the -Internet. By default, I give them the lowest priority, because although this is -something for me to remember later, it is not by default important. You can see -in the properties I record when the capture happened, and what the link is. The -title of the capture is a summary of what this is, while the body of the capture -is a more detailed explanation of what I capture, why, and how it could be -useful to me. -#+BEGIN_SRC org :tangle ~/org/capture/resource.orgcaptmpl - ,* TODO [#C] %^{Title} - :PROPERTIES: - :CAPTURED: %U - :LINK: %^{Link} - :END: - %? -#+END_SRC - -***** Tasks -:PROPERTIES: -:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Tasks-3fcf382a -:END: -****** Computers and stuff -:PROPERTIES: -:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Tasks-Computers_and_stuff-a4eef8e3 -:END: -One type of task I often capture is related to my servers or thing about -computers in general. With this, I can capture a task for which I will either -set a schedule or a deadline. -#+BEGIN_SRC org :tangle ~/org/capture/informatique.orgcaptmpl - ,* TODO %^{Title} - %^{Scheduled or Deadline?||SCHEDULED||DEADLINE}: %^t - :PROPERTIES: - :CATEGORY: %^{Category} - :END: - %? -#+END_SRC - -****** Health -:PROPERTIES: -:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Tasks-Health-74f8f338 -:END: -This capture is rarely used (I’m lucky to have a good health), but it can be -useful. -#+BEGIN_SRC org :tangle ~/org/capture/health.orgcaptmpl - ,* %^{Title} - SCHEDULED: %^t - - %? -#+END_SRC - -****** Birthdays -:PROPERTIES: -:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Tasks-Birthdays-ec3b27be -:END: -This capture is used to store new birthdays I have to remember. They are set to -be repeated yearly. -#+BEGIN_SRC org :tangle ~/org/capture/birthday.orgcaptmpl - ,* %^{Name} - SCHEDULED: %^t -#+END_SRC - -****** Events -:PROPERTIES: -:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Tasks-Events-7f0f8dee -:END: -#+BEGIN_SRC org :tangle ~/org/capture/event.orgcaptmpl - ,* %^{Title} - %^{Scheduled or deadline?||SCHEDULED||DEADLINE}: %^t - %? -#+END_SRC - -***** Links -:PROPERTIES: -:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Links-586a6b2a -:END: -****** General -:PROPERTIES: -:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Links-General-1f0732db -:END: -#+BEGIN_SRC org :tangle ~/org/capture/link.orgcaptmpl - ,* TODO [#C] %^{Title} - :PROPERTIES: - :CAPTURED: %U - :LINK: %^{Link} - :END: - %? -#+END_SRC - -****** YouTube -:PROPERTIES: -:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Links-YouTube-b89fe20e -:END: -#+BEGIN_SRC org :tangle ~/org/capture/youtube.orgcaptmpl - ,* TODO [#C] %^{Title} - :PROPERTIES: - :CAPTURED: %U - :AUTHOR: %^{Author} - :LINK: %^{Link} - :END: - %? -#+END_SRC +My org capture templates are not tangled into my Emacs configuration +files, but into separate ~.orgcaptmpl~ files stored into =~/org/capture/=. +You can find these in my repository [[https://labs.phundrak.com/phundrak/dotfiles/src/branch/master/org/capture][here]] or [[https://github.com/Phundrak/dotfiles/tree/master/org/capture][here]]. **** Custom org-mode functions :PROPERTIES: