diff options
| author | Blake Romero <blake@developercraft.com> | 2025-10-18 21:41:19 +0100 |
|---|---|---|
| committer | Blake Romero <blake@developercraft.com> | 2025-10-18 21:41:19 +0100 |
| commit | 3e3626e3b3f326f99ad2088ad32e90a51407b82e (patch) | |
| tree | 1088634570fae37a602278b68a465490c86d0079 /emacs-config.org | |
| parent | b1aca3ec23009d03295bf6c4d0883d960b9c698f (diff) | |
Add & enable auto-insert templates
Diffstat (limited to 'emacs-config.org')
| -rw-r--r-- | emacs-config.org | 28 |
1 files changed, 28 insertions, 0 deletions
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 |
