Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
65 lines (56 sloc) 1.96 KB
(use-package org-roam
:diminish org-roam-mode)
(setq org-roam-directory
(setq org-roam-buffer-position 'bottom)
(setq org-roam-completion-system 'ivy)
(whicher "dot")
(setq org-roam-capture-templates
:file-name "%<%Y-%m-%d_%H:%M>-${slug}"
:head "#+title: ${title}\n* Tasks\n"
:unnarrowed t)))
(defhydra hydra-org-roam (:exit t :idle 0.8)
"Launcher for `org-roam'."
("i" org-roam-insert "insert")
("f" ora-org-roam-find-file "find-file")
("v" org-roam-buffer-activate "backlinks")
("t" ora-roam-todo "todo"))
(defun ora-org-roam-find-file-action (x)
(if (consp x)
(let ((file-path (plist-get (cdr x) :path)))
(org-roam--find-file file-path))
(let* ((title-with-tags x)
`((title . ,title-with-tags)
(slug . ,(funcall org-roam-title-to-slug-function title-with-tags))))
(org-roam-capture--context 'title))
(setq org-roam-capture-additional-template-props (list :finalize 'find-file))
(defun ora-org-roam-find-file ()
(unless org-roam-mode (org-roam-mode))
(ivy-read "File: " (org-roam--get-title-path-completions)
:action #'ora-org-roam-find-file-action
:caller 'ora-org-roam-find-file))
(defun ora-roam-todo ()
"An ad-hoc agenda for `org-roam'."
(let* ((regex "^\\* TODO")
(b (get-buffer (concat "*ivy-occur counsel-rg \"" regex "\"*"))))
(if b
(switch-to-buffer b)
(setq unread-command-events (listify-key-sequence (kbd "C-c C-o M->")))
(counsel-rg regex org-roam-directory "--sort modified"))))
(provide 'ora-org-roam)