new-day: macro "<EscapeKey>>----------------<EnterKey>A-xinsert da <EnterKey><EnterKey><EnterKey><TabKey>"
... which I bind to C-M-N.I have the following batch file in my path:
note.cmd
--------
@echo off
epsilon -add +9999999 %USERPROFILE%\notes.txt
You can tell I'm running Windows; I have a similar thing for Linux (Epsilon also runs there).That's it. Nothing fancy. You could do it with just about any modern editor.
(defun new-note ()
(interactive)
(insert "----------------\n")
(insert (shell-command-to-string "echo -n $(date \"+%Y-%m-%d %T\")"))
(insert "\n"))
(global-set-key (kbd "C-M-n") #'new-note)
And to invoke it from the shell: emacs --function new-note --file notes.txt
If somebody knows a better or more elegant way to do this, please tell me! # -*- mode: snippet -*-
# name: note
# key: note
# --
----------------
`(format-time-string "%Y-%m-%d %T")`
$1I'm not sure if your setup does that.
It's the minor creature comforts that really matter sometimes.
I had to set keybinding to C-c C-n because I got unmatched parentheses error with C-M-n.
I've been slowly moving to emacs since this summer and got to where I like it better than Vim. I was "forced" to learn it as I am learning Lisp (started with Clojure but moved to Common Lisp).
I’m really curious.
I also think it's got much better integration with Windows, though I can't point at anything in particular. (Its integration on MacOS is less wonderful).
It also helps that its defaults mostly line up with my own preferences in an editor, though this is highly subjective.