From c10dea1ec1faa15ab27d0c9a685aed8098fbb520 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Wed, 3 Apr 2024 05:07:17 +0300 Subject: emacs:(org-raom) Add dailies keybindings & org-roam-sync-notes --- .emacs.d/init.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to '.emacs.d') 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))) -- cgit v1.2.3