Skip to content

Instantly share code, notes, and snippets.

@danp
Created March 3, 2014 14:36
Show Gist options
  • Select an option

  • Save danp/9326276 to your computer and use it in GitHub Desktop.

Select an option

Save danp/9326276 to your computer and use it in GitHub Desktop.
(defun new-notes-buffer ()
"Create and switch to a new notes buffer. Name based on current timestamp."
(interactive)
(switch-to-buffer
(find-file-noselect
(expand-file-name
(concat
"~/Documents/notes/notes-"
(format-time-string "%Y-%m-%d-%H-%M-%S")
".txt")))))
(global-set-key (kbd "M-n") 'new-notes-buffer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment