summary refs log tree commit diff
path: root/emacs/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/init.el')
-rw-r--r--emacs/init.el25
1 files changed, 18 insertions, 7 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 5ea9fc6..0c3e08f 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -736,13 +736,6 @@ The misspelled word is taken from OVERLAY.  WORD is the corrected word."
   ("<C-f12>" . howm-create))
 (setopt howm-file-name-format "%Y-%m-%dT%H%M%S.md")
 
-(defun noa/open-todays-diary ()
-  (interactive)
-  (let ((date (format-time-string "%Y-%m-%d")))
-    (find-file (format "~/Documents/notes/diary/%s.md"  date))
-    (if (= (buffer-size) 0)
-        (insert (concat "# " date "\n\n")))))
-
 ;;; Bibliography management
 (use-package ebib
   :ensure t
@@ -770,3 +763,21 @@ The misspelled word is taken from OVERLAY.  WORD is the corrected word."
   (xeft-filename-fn (lambda (search)
                       (format-time-string "%Y-%m-%dT%H%M%S.md")))
   (xeft-recursive t))
+(defun noa/yank-buffer-file-name ()
+  (interactive)
+  (when (buffer-file-name)
+    (kill-new (file-name-nondirectory (buffer-file-name)))))
+
+(use-package ctrlj)
+(global-unset-key (kbd "C-j"))
+(global-set-key (kbd "C-j C-j") #'ctrlj/open-note)
+(global-set-key (kbd "C-j C-n") #'ctrlj/new-note)
+(global-set-key (kbd "C-j C-l") #'ctrlj/insert-link-to-note)
+(global-set-key (kbd "C-j C-d") #'ctrlj/open-todays-diary)
+(global-set-key (kbd "C-j C-a") #'ctrlj/view-agenda)
+(global-set-key (kbd "C-j C-o") #'ctrlj/jump-to-other-related-note)
+
+(defun noa/consult-rg-notes ()
+  (interactive)
+  (consult-ripgrep "~/Documents/notes"))
+(global-set-key (kbd "C-j C-s") #'noa/consult-rg-notes)