Created
April 19, 2019 06:32
-
-
Save todokr/17c44953a865960a53a55644628a4462 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-package auto-insert-mode) | |
(auto-insert-mode t) | |
;; テンプレート置き場 | |
(setq auto-insert-directory "~/.emacs.d/insert/") | |
;; "~nippo.md"というファイルをテンプレートの挿入対象に設定 | |
(define-auto-insert "_nippo\\.md$" "nippo-template.md") | |
;; 日報の雛形をいい感じに生成するぞ! | |
(defun gen-nippo-template () | |
(interactive) | |
(let* ((file (expand-file-name | |
(format-time-string | |
"%Y-%m-%d_nippo.md" (current-time)) ;; ex) 2019-04-19_nippo.md | |
"~/nippo/")) | |
(dir (file-name-directory file))) | |
(make-directory dir t) | |
(find-file-other-window file))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment