summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emacs-config.org28
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