From 9b2bdd4e34955b4277255dd5c38a79cd19ab1349 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 12 Apr 2020 22:50:39 +0200 Subject: [PATCH] Setup org-roam --- config.org | 36 ++++++++++++++++++++++++++++++++++++ init.el | 3 ++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/config.org b/config.org index 5a53af4..9cecb83 100644 --- a/config.org +++ b/config.org @@ -12,6 +12,7 @@ - [[#agenda-setup][Agenda setup]] - [[#journal][Journal]] - [[#org-ids][Org IDs]] + - [[#roam][Roam]] - [[#doom-specific][Doom specific]] * Misc @@ -230,6 +231,41 @@ links to work: (add-to-list 'org-modules 'org-id) #+END_SRC +** Roam + +Setup for [[https://github.com/jethrokuan/org-roam][org-roam]]. + +First, set a directory where =org-roam= will index things. + +#+BEGIN_SRC emacs-lisp +(setq org-roam-directory (expand-file-name "notes/" org-directory)) +#+END_SRC + +Customize the capture templates: + +- the first one is [[https://github.com/jethrokuan/org-roam/blob/772505ba70c073ebc7905c4fcb8b9cc3759c775a/org-roam-capture.el#L81][the default one]], I just removed the timestamp from the file + title. +- the second one I use to create new entries about website links, blog posts, + articles... The ~%x~ in the template is replaced by the content of my X + clipboard, so I just have to copy the website URL before capturing it. + + +#+BEGIN_SRC emacs-lisp +(after! org-roam + (setq org-roam-capture-templates + '(("d" "default" plain (function org-roam-capture--get-point) + "%?" + :file-name "${slug}" + :head "#+TITLE: ${title}\n" + :unnarrowed t) + ("w" "website" plain (function org-roam-capture--get-point) + "" + :file-name "websites/${slug}" + :head "#+TITLE: ${title} +#+ROAM_KEY: %x\n" + :unnarrowed t)))) +#+END_SRC + ** Doom specific Doom replaces the default tab behavior on headings, this restores the default diff --git a/init.el b/init.el index c96aaaa..e634094 100644 --- a/init.el +++ b/init.el @@ -138,7 +138,8 @@ nix ; I hereby declare "nix geht mehr!" ;;ocaml ; an objective camel (org ; organize your plain life in plain text - +journal) + +journal + +roam) ;;perl ; write code no one else can comprehend ;;php ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more