mirror of
https://github.com/foo-dogsquared/dotfiles.git
synced 2025-02-07 06:18:59 +00:00
Update org-mode snippets
As of 2021-04-12, org-mode is apparently standardized in lowercase so we'll follow that for the sake of future-proofing.
This commit is contained in:
parent
85603bd00a
commit
90be31cc52
@ -68,61 +68,71 @@
|
|||||||
(add-to-list 'safe-local-variable-values
|
(add-to-list 'safe-local-variable-values
|
||||||
'(TeX-command-extra-options . "-shell-escape")))
|
'(TeX-command-extra-options . "-shell-escape")))
|
||||||
|
|
||||||
(setq
|
|
||||||
; Set the journal.
|
|
||||||
org-journal-dir "~/writings/journal"
|
|
||||||
org-journal-file-format "%F"
|
|
||||||
|
|
||||||
; Set the capture
|
|
||||||
org-capture-templates `(
|
|
||||||
("i" "inbox" entry (file ,(concat org-directory "/inbox.org"))
|
|
||||||
,(concat "* TODO %?\n"
|
|
||||||
"entered on %<%F %T %:z>"))
|
|
||||||
|
|
||||||
("p" "project" entry (file ,(concat org-directory "/projects.org"))
|
|
||||||
,(concat "* PROJ %?\n"
|
|
||||||
"- [ ] %?"))
|
|
||||||
|
|
||||||
("c" "org-protocol-capture" entry (file ,(concat org-directory "/inbox.org"))
|
|
||||||
"* TODO [[%:link][%:description]]\n%x"
|
|
||||||
:immediate-finish t)))
|
|
||||||
|
|
||||||
(after! org
|
(after! org
|
||||||
(setq
|
(setq
|
||||||
; Set a custom time-stamp pattern.
|
time-stamp-start "date_modified:[ ]+\\\\?[\"<]+"
|
||||||
; Even though, it's not recommended, most of the time, it is mainly for personal documents so it is safe.
|
; Set the capture
|
||||||
time-stamp-start "DATE_MODIFIED:[ ]+\\\\?[\"<]+"
|
org-capture-templates `(
|
||||||
|
("i" "inbox" entry
|
||||||
|
(file ,(concat org-directory "/inbox.org"))
|
||||||
|
,(concat "* TODO %?\n"
|
||||||
|
"entered on %<%F %T %:z>"))
|
||||||
|
|
||||||
|
("p" "project" entry
|
||||||
|
(file ,(concat org-directory "/projects.org"))
|
||||||
|
,(concat "* PROJ %?\n"
|
||||||
|
"- [ ] %?"))
|
||||||
|
|
||||||
|
("c" "org-protocol-capture" entry
|
||||||
|
(file ,(concat org-directory "/inbox.org"))
|
||||||
|
"* TODO [[%:link][%:description]]\n%x"
|
||||||
|
:immediate-finish t))
|
||||||
|
|
||||||
; Configure org-roam.
|
; Configure org-roam.
|
||||||
org-roam-capture-templates '(
|
org-roam-capture-templates '(
|
||||||
("d" "default" plain (function org-roam--capture-get-point)
|
("n" "notes" plain
|
||||||
"#+AUTHOR: \"%(user-full-name)\"
|
#'org-roam-capture--get-point
|
||||||
#+EMAIL: \"%(user-mail-address)\"
|
"#+author: \"%(user-full-name)\"
|
||||||
#+DATE: \"%<%Y-%m-%d %T %:z>\"
|
#+email: \"%(user-mail-address)\"
|
||||||
#+DATE_MODIFIED: \"%<%Y-%m-%d %T %:z>\"
|
#+date: \"%<%Y-%m-%d %T %:z>\"
|
||||||
#+LANGUAGE: en
|
#+date_modified: \"%<%Y-%m-%d %T %:z>\"
|
||||||
#+OPTIONS: toc:t
|
#+language: en
|
||||||
#+PROPERTY: header-args :exports both
|
#+options: toc:t
|
||||||
|
#+property: header-args :exports both
|
||||||
|
|
||||||
%?"
|
%?"
|
||||||
:file-name "%<%Y-%m-%d-%H-%M-%S>"
|
:file-name "%<%Y-%m-%d-%H-%M-%S>"
|
||||||
:head "#+TITLE: ${title}\n"
|
:head "#+title: ${title}\n"
|
||||||
:unnarrowed t))))
|
:unnarrowed t)
|
||||||
|
|
||||||
|
("d" "dailies" entry
|
||||||
|
#'org-roam-capture--get-point
|
||||||
|
"* %?"
|
||||||
|
:file-name "daily/%<%Y-%m-%d>"
|
||||||
|
:head "#+title %<%Y-%m-%d>"
|
||||||
|
:olp ("Study notes" "Random")))
|
||||||
|
|
||||||
|
; Get the tags from vanilla and Roam-specific properties.
|
||||||
|
org-roam-tag-sources '(prop vanilla))
|
||||||
|
(add-to-list 'org-modules 'org-checklist))
|
||||||
|
|
||||||
(setq
|
(setq
|
||||||
; Modify the time-stamp with each save.
|
; Modify the time-stamp with each save.
|
||||||
time-stamp-format "%Y-%02m-%02d %02H:%02M:%02S %:z"
|
time-stamp-format "%Y-%02m-%02d %02H:%02M:%02S %:z"
|
||||||
|
|
||||||
; Set file templates folder at $DOOMDIR/templates.
|
; Set file templates folder at $DOOMDIR/templates.
|
||||||
+file-templates-dir (expand-file-name "templates/" doom-private-dir))
|
+file-templates-dir (expand-file-name "templates/" doom-private-dir)
|
||||||
|
|
||||||
; Automate updating timestamps.
|
; Set the journal.
|
||||||
|
org-journal-dir "~/writings/journal"
|
||||||
|
org-journal-file-format "%F"
|
||||||
|
)
|
||||||
|
|
||||||
|
; A workaround for electric-indent plugin.
|
||||||
|
; See https://github.com/hlissner/doom-emacs/issues/3172 for more details.
|
||||||
|
(add-hook 'org-mode-hook (lambda () (electric-indent-local-mode -1)))
|
||||||
|
|
||||||
|
; Automate updating timestamps on save.
|
||||||
(add-hook 'before-save-hook 'time-stamp)
|
(add-hook 'before-save-hook 'time-stamp)
|
||||||
|
|
||||||
(add-to-list 'org-modules 'org-checklist)
|
;;; config.el ends here
|
||||||
|
|
||||||
; Org-roam-bibtex is somehow a horrible name.
|
|
||||||
; I guess that's why they insist on calling it ORB.
|
|
||||||
(use-package! org-roam-bibtex
|
|
||||||
:after-call org-mode
|
|
||||||
:hook (org-roam-mode . org-roam-bibtex-mode))
|
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
# name: Org-Mode appendix block
|
# name: Org-Mode appendix block
|
||||||
# key: appendix
|
# key: appendix
|
||||||
# --
|
# --
|
||||||
:PROPERTIES:
|
:properties:
|
||||||
:APPENDIX: t
|
:appendix: t
|
||||||
:END:
|
:end:
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
# name: Org-Mode dynamic blocks
|
# name: Org-Mode dynamic blocks
|
||||||
# key: block
|
# key: block
|
||||||
# --
|
# --
|
||||||
\#+BEGIN: ${1:<PARAMETERS>}
|
\#+begin: ${1:<PARAMETERS>}
|
||||||
$2
|
$2
|
||||||
\#+END:
|
\#+end:
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
# name: Org-Mode comment block
|
# name: Org-Mode comment block
|
||||||
# key: comment
|
# key: comment
|
||||||
# --
|
# --
|
||||||
#+BEGIN_COMMENT
|
#+begin_comment
|
||||||
$0
|
$0
|
||||||
#+END_COMMENT
|
#+end_comment
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
# name: Org-Mode image
|
# name: Org-Mode image
|
||||||
# key: img
|
# key: img
|
||||||
# --
|
# --
|
||||||
#+CAPTION: $1
|
#+caption: $1
|
||||||
#+NAME: $2
|
#+name: $2
|
||||||
[[${3:<LINK>}]
|
[[${3:<LINK>}]
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
# name: Org-Mode local property block
|
# name: Org-Mode local property block
|
||||||
# key: props
|
# key: props
|
||||||
# --
|
# --
|
||||||
:PROPERTIES:
|
:properties:
|
||||||
$1
|
$1
|
||||||
:END:
|
:end:
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
# name: Org-Mode source block
|
# name: Org-Mode source block
|
||||||
# key: quote
|
# key: quote
|
||||||
# --
|
# --
|
||||||
#+BEGIN_QUOTE
|
#+begin_quote
|
||||||
$1
|
$1
|
||||||
#+END_QUOTE
|
#+end_quote
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
# name: Org-Mode source block
|
# name: Org-Mode source block
|
||||||
# key: csrc
|
# key: csrc
|
||||||
# --
|
# --
|
||||||
#+BEGIN_SRC ${1:<LANG>} :results output :exports both :session *${2:<SESSION NAME>}*
|
#+begin_src ${1:<LANG>} :results output :exports both :session *${2:<SESSION NAME>}*
|
||||||
$3
|
$3
|
||||||
#+END_SRC
|
#+end_src
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
# name: Org-Mode video block (on HTML, anyways)
|
# name: Org-Mode video block (on HTML, anyways)
|
||||||
# key: video
|
# key: video
|
||||||
# --
|
# --
|
||||||
#+ATTR_HTML: :controls controls
|
#+attr_html: :controls controls
|
||||||
#+BEGIN_video
|
#+begin_video
|
||||||
#+HTML: <source src="${1:<VIDEO URL>}">
|
#+html: <source src="${1:<VIDEO URL>}">
|
||||||
Your browser does not support the video tag.
|
Your browser does not support the video tag.
|
||||||
#+END_video
|
#+end_video
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# -*- mode: snippet -*-
|
# -*- mode: snippet -*-
|
||||||
# name: Org template
|
# name: Org template
|
||||||
# --
|
# --
|
||||||
#+TITLE: ${1:`
|
#+title: ${1:`
|
||||||
(string-join
|
(string-join
|
||||||
(mapcar #'capitalize
|
(mapcar #'capitalize
|
||||||
;; Replace -,_... with space
|
;; Replace -,_... with space
|
||||||
@ -16,13 +16,13 @@
|
|||||||
"[^[:word:]0-9]+"
|
"[^[:word:]0-9]+"
|
||||||
)) " " )
|
)) " " )
|
||||||
`}
|
`}
|
||||||
#+AUTHOR: "`user-full-name`"
|
#+author: "`user-full-name`"
|
||||||
#+EMAIL: "`user-mail-address`"
|
#+email: "`user-mail-address`"
|
||||||
#+DATE: "`(format-time-string "%Y-%m-%d %T %:z")`"
|
#+date: "`(format-time-string "%Y-%m-%d %T %:z")`"
|
||||||
#+DATE_MODIFIED: "`(format-time-string "%Y-%m-%d %T %:z")`"
|
#+date_modified: "`(format-time-string "%Y-%m-%d %T %:z")`"
|
||||||
#+LANGUAGE: en
|
#+language: en
|
||||||
#+OPTIONS: toc:t
|
#+options: toc:t
|
||||||
#+PROPERTY: header-args :exports both
|
#+property: header-args :exports both
|
||||||
|
|
||||||
|
|
||||||
$0
|
$0
|
||||||
|
Loading…
Reference in New Issue
Block a user