summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.emacs.d/init.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index a0d32f0..3e7008c 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -245,11 +245,30 @@
("p" "MUS" plain "* Goals\n\n%?\n\n* Tasks\n\n** TODO Add initial tasks\n\n* Dates\n\n"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n#+filetags: MUS")
:unnarrowed t)))
+
+ (defun org-roam-sync-notes ()
+ "Sync org-oram notes"
+ (interactive)
+ (let ((git (executable-find "git"))
+ (default-directory org-roam-directory))
+ (message "Synching org-roam notes %s" org-roam-directory)
+ (unless git
+ (error "Git not found, please install git"))
+ (unless (file-exists-p (expand-file-name ".git" gnosis-dir))
+ (message "Creating git repository")
+ (vc-create-repo 'Git))
+ (shell-command "git pull")
+ (shell-command (format "%s %s" git "add ."))
+ (shell-command (format "%s %s %s" git "commit -m" (shell-quote-argument "Update org-roam notes")))
+ (vc-git-push nil))
+ (funcall 'org-roam-db-sync))
:bind (("C-c n" . thanos/notes-map)
:map thanos/notes-map
("t" . org-roam-buffer-toggle)
("f" . org-roam-node-find)
("i" . org-roam-node-insert)
+ ("d" . org-roam-dailies-goto-today)
+ ("D" . org-roam-dailies-goto-date)
:map org-mode-map
("C-c C-." . org-roam-tag-add)
("C-c i" . org-id-get-create)))