Friday, November 16, 2007

Emacs でテンプレートを自動挿入設定


(require 'autoinsert)
(setq auto-insert-directory "~/.codeTemplate/")
(setq auto-insert-alist
(nconc '( ("\\.tex$" . "template.tex")
("\\.c$" . "template.c")
("\\.cpp$" . "template.cpp")
("\\.js$" . "template.js")
("\\.html$" . "template.html")
("\\.css$" . "template.css")
("\\.rb$" . "template.rb")
) auto-insert-alist))

(add-hook 'find-file-not-found-hooks 'auto-insert)

No comments: