From e7d5f0d3b4901a79f18faa5bc554ad440322aeb7 Mon Sep 17 00:00:00 2001 From: noa Date: Sun, 16 Feb 2025 21:52:01 +0800 Subject: Add command to add a new note --- emacs/init.el | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'emacs') 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 -- cgit 1.4.1-2-gfad0