You may want to check out this example wherein the author suggests this
"In-buffer settings info for a emacs-org file."
"#+TITLE:" str " \n"
"#+AUTHOR: Your Name\n"
"#+BABEL: :session *R* :cache yes :results output graphics :exports both :tangle yes \n"
(global-set-key [C-S-f4] 'org-skeleton)
Customize to please. But like so many things in the Emacs world, I don't know if this is "best practice."
There is also
autoinsert which will insert lines whenever you create a new file. Here's what I have in my init:
;; Don't want to be prompted before insertion:
(setq auto-insert-query nil)
(setq auto-insert-directory (locate-user-emacs-file "templates"))
(add-hook 'find-file-hook 'auto-insert)
(define-auto-insert "\\.org?$" "default-org.org"))
Note the last line
(define-auto-insert "\\.org?$" "default-org.org") So the file
default-org.org (in my
.emacs.d directory) contains my customized in-buffer settings, which will be automatically inserted at the top whenever I create a file with an
Unfortunately, I could not figure out how to plant variables and expanding things in this template, as is supposedly possible. (See this cry for help.)