aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2020-09-27 22:20:38 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2020-09-27 22:20:38 +0100
commitb0aae95a5b5fd666251721a3ec127113a30e721f (patch)
treec9e4d0112541278183cf2144f1713136f0b12b8e
parent51fcea69fcda68d7f8f415c6b4c1e761ddb1a14b (diff)
downloaddotfiles-b0aae95a5b5fd666251721a3ec127113a30e721f.tar.gz
dotfiles-b0aae95a5b5fd666251721a3ec127113a30e721f.tar.bz2
dotfiles-b0aae95a5b5fd666251721a3ec127113a30e721f.zip
(Emacs)+configuration for auto insertion systems
-rw-r--r--Emacs/.config/emacs/config.org21
1 files changed, 21 insertions, 0 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org
index bf560ac..a7ff5bc 100644
--- a/Emacs/.config/emacs/config.org
+++ b/Emacs/.config/emacs/config.org
@@ -835,6 +835,27 @@ Defining some basic skeletons
""
',skeleton-name)))))
#+end_src
+*** Auto insertion
+Inserting text into new file buffers because templates are cool.
+#+begin_src emacs-lisp
+(use-package auto-insert
+ :straight nil
+ :hook (find-file-hook . auto-insert)
+ :config
+ (defmacro +autotyping/create-auto-insert (REGEX DESC SKEL-NAME &rest SKELETON)
+ "For a given REGEX with a possible DESC, define a skeleton
+with SKEL-NAME and SKELETON body and bind it to the
+auto-insert-alist"
+ `(progn
+ (define-skeleton
+ ,SKEL-NAME
+ ""
+ ,@SKELETON)
+ (add-to-list
+ 'auto-insert-alist
+ '((,REGEX . ,DESC)
+ ,SKEL-NAME)))))
+#+end_src
*** Yasnippet default
:PROPERTIES:
:header-args:emacs-lisp: :tangle no