summary refs log tree commit diff
path: root/emacs
diff options
context:
space:
mode:
authornoa2025-02-16 21:52:01 +0800
committernoa2025-02-16 21:52:01 +0800
commite7d5f0d3b4901a79f18faa5bc554ad440322aeb7 (patch)
tree66cc13e553c152cdaf01bb4edf951ab8f5e5a8dd /emacs
parenteda24700293d6132ec338d5a060418e6ad333677 (diff)
Add command to add a new note
Diffstat (limited to 'emacs')
-rw-r--r--emacs/init.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/emacs/init.el b/emacs/init.el
index bcfd7a0..7d67d90 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -925,6 +925,17 @@ necessary variables are set."
   :mode ((rx (or ".lisp" ".cl") eos) . common-lisp-mode))
 
 
+(defun note/new (&optional other-window)
+  (interactive "P")
+  (let* ((uid (format-time-string "%Y-%m-%d-%H%M%S"))
+         (note (concat note/directory "/" uid "." note/file-ending)))
+    (if other-window
+        (progn
+          (insert "[[./" uid ".org]]")
+          (find-file-other-window note))
+      (find-file note))
+    ))
+
 (use-package ediff
   :defer t
   :custom