diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2020-09-27 21:57:18 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2020-09-27 21:57:18 +0100 |
commit | 46b80367c1b796a93cd39ac2eb16265d05813d6f (patch) | |
tree | 24dc5fe3feb93977c59e049adc9c5883a9cf4de9 /Emacs/.config | |
parent | 356931d9e332e06ffcc1d23e2e47c94337292980 (diff) | |
download | dotfiles-46b80367c1b796a93cd39ac2eb16265d05813d6f.tar.gz dotfiles-46b80367c1b796a93cd39ac2eb16265d05813d6f.tar.bz2 dotfiles-46b80367c1b796a93cd39ac2eb16265d05813d6f.zip |
(Emacs)+config for skeletons
Macro to generate an abbrev as well as a skeleton
Diffstat (limited to 'Emacs/.config')
-rw-r--r-- | Emacs/.config/emacs/config.org | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index 8ade726..63e23b2 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -889,6 +889,26 @@ with abstracting a few things away. "fmonth" (format-time-string "%B" (current-time)))) #+end_src +*** Skeletons +Defining some basic skeletons +#+begin_src emacs-lisp +(use-package skeleton + :straight nil + :after abbrev + :config + (defmacro +snippets/gen-skeleton-abbrev (mode abbrev &rest skeleton) + (let* ((table (intern (concat (symbol-name mode) "-abbrev-table"))) + (skeleton-name (intern (concat "+" "skeleton/" (symbol-name mode) "/" abbrev)))) + `(progn + (define-skeleton + ,skeleton-name + "" + ,@skeleton) + (define-abbrev ,table + ,abbrev-name + "" + ',skeleton-name))))) +#+end_src *** Yasnippet default :PROPERTIES: :header-args:emacs-lisp: :tangle no |