vmobat
1
I am new to spacemacs. I was able to install org-roam with
(org :variables
org-enable-roam-support t)
But I can’t figure out how to set up templates
Here is what I have in my user-config section
(defun dotspacemacs/user-config ()
(with-eval-after-load 'org
///// a bunch of org-related properties
)
(use-package org-roam
:after org
:hook (org-mode . org-roam-mode)
:custom
(org-roam-directory "~/Dropbox/org/org-roam")
(setq org-roam-dailies-capture-templates
'(("d" "default" entry
#'org-roam-capture--get-point
"* %<%Y-%m-%d-%H-%M> %? :daily:"
:file-name "daily/%<%Y-%m-%d>"
:head "#+title: %<%Y-%m-%d>\n\n")))
(setq org-roam-capture-templates
'(("d" "default" plain
(function org-roam-capture--get-point)
"%?"
:file-name "%<%Y%m%d%H%M%S>-${slug}"
:head "#+TITLE: ${title}\n#+CREATED: %U\n\#+TAGS:\n\n"
:unnarrowed t)))
:bind
("C-c n l" . org-roam)
("C-c n t" . org-roam-today)
("C-c n f" . org-roam-find-file)
("C-c n i" . org-roam-insert)
("C-c n g" . org-roam-show-graph))
)
Pretty much everything works as intended with exception of templates
when I do org-roam-capture
provided template is completely ignored.
I’d greatly appreciate any pointers.
vmobat
2
after browsing on GitHub and lurking for other people’s .spacemacs I was able to figure it out.
posting it here for posterity.
(with-eval-after-load 'org
(setq org-agenda-files (directory-files-recursively “~/Dropbox/org/” “\.org$”))
(setq org-directory "~/Dropbox/org")
(setq org-roam-directory "~/Dropbox/org/org-roam")
(setq org-roam-dailies-directory "~/Dropbox/org/org-roam/daily/")
(add-hook 'after-init-hook 'org-roam-mode)
(spacemacs/set-leader-keys
;; "arl" 'org-roam
"aordd" 'org-roam-dailies-find-today
;; "arf" 'org-roam-find-file
;; "arg" 'org-roam-graph
)
(spacemacs/set-leader-keys-for-major-mode 'org-mode
"rdd" 'org-roam-dailies-find-today
"rdy" 'org-roam-dailies-find-yesterday
"rdt" 'org-roam-dailies-find-tomorrow
"rdc" 'org-roam-dailies-date
"rdh" 'org-roam-dailies-find-previous-note
"rdl" 'org-roam-dailies-find-next-note
)
(setq org-roam-dailies-capture-templates
'(("d" "default" entry
#'org-roam-capture--get-point
"* %<%Y-%m-%d-%H-%M> %? :daily:"
:file-name "daily/%<%Y-%m-%d>"
:head "#+title: %<%Y-%m-%d>\n\n")))
(setq org-roam-capture-templates
'(("d" "default" plain
(function org-roam-capture--get-point)
"%?"
:file-name "%<%Y%m%d%H%M%S>-${slug}"
:head "#+TITLE: ${title}\n#+CREATED: %U\n\#+TAGS:\n\n"
:unnarrowed t)
("p" "probability" plain
(function org-roam-capture--get-point)
"%?"
:file-name "%<%Y%m%d%H%M%S>-${slug}"
:head "#+TITLE: ${title}\n#+CREATED: %U\n\#+TAGS: probability\n\n"
:unnarrowed t)
("a" "algo" plain
(function org-roam-capture--get-point)
"%?"
:file-name "%<%Y%m%d%H%M%S>-${slug}"
:head "#+TITLE: ${title}\n#+CREATED: %U\n\#+TAGS: algorithms\n\n"
:unnarrowed t)
("o" "optimization" plain
(function org-roam-capture--get-point)
"%?"
:file-name "%<%Y%m%d%H%M%S>-${slug}"
:head "#+TITLE: ${title}\n#+CREATED: %U\n\#+TAGS: optimization\n\n"
:unnarrowed t)))
)
)