From 3e3626e3b3f326f99ad2088ad32e90a51407b82e Mon Sep 17 00:00:00 2001 From: Blake Romero Date: Sat, 18 Oct 2025 21:41:19 +0100 Subject: Add & enable auto-insert templates --- emacs-config.org | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'emacs-config.org') diff --git a/emacs-config.org b/emacs-config.org index b219af2..43535c4 100644 --- a/emacs-config.org +++ b/emacs-config.org @@ -1657,6 +1657,34 @@ C-mode abbrev table. > -2 "}") #+end_src +** Auto-insert +Enable. +#+begin_src elisp + (auto-insert-mode) +#+end_src + +Set templates. +#+begin_src elisp + (setq-default auto-insert-directory "~/templates/") +#+end_src + +Main C file template. +#+begin_src elisp + (cl-pushnew '(("main.c\\'" . "Main C File") . "main.c") + auto-insert-alist) +#+end_src + +Makefile template. +#+begin_src elisp + (cl-pushnew '(("[mM]akefile\\'" . "Makefile Template") . "makefile") + auto-insert-alist) +#+end_src + +Add hook to auto-insert. +#+begin_src elisp + (add-hook 'find-file-hook 'auto-insert) +#+end_src + * Global Keybindings Unlock previously unusable keybinding. #+begin_src elisp -- cgit