From 1da0fda75b5d2d95a82e04849dfb3c43b53ebccb Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sun, 27 Sep 2020 21:45:03 +0100 Subject: (Emacs)~yasnipet -> snippets Now creating a system to use skeleton and abbrev to replace yasnippet --- Emacs/.config/emacs/config.org | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'Emacs/.config/emacs') diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index 0a1f027..9b70c03 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -830,12 +830,29 @@ Use hydras for stuff that I use often, currently buffer manipulation ("p" dx:paste-section) ("TAB" evil-toggle-fold))) #+end_src -** Yasnippet -*** Preamble -Yasnippet is a great package for snippets, which I use heavily in -programming and org-mode. I setup here the global mode for yasnippet -and a collection of snippets for ease of use. +** Snippets +*** Snippets Preamble +Snippets are a system by which pieces of code can be inserted via +prefixes. For example, an 'if' snippet would work by first inserting +the word 'if' then pressing some _expansion key_ such as TAB. This +will insert a set of text that may be have some components that need +to be further filled by the user. + +The popular solution is Yasnippet. Yasnippet is a great package for +snippets, which I use heavily in programming and org-mode. I setup +here the global mode for yasnippet and a collection of snippets for +ease of use. + +However, Emacs provides its own 'auto typing' facilities. Abbrevs and +skeletons make up the popular solution within Emacs default. Abbrevs +are for simple expressions wherein there is only one user input (say, +getting today's time which only requires you asking for it). They +provide a lot of inbuilt functionality and are quite useful. +Skeletons, on the other hand, are for higher level insertions *** Yasnippet default +:PROPERTIES: +:header-args:emacs-lisp: :tangle no +:END: Setup global mode after evil mode has been loaded #+begin_src emacs-lisp (use-package yasnippet @@ -850,6 +867,9 @@ Setup global mode after evil mode has been loaded (yas-load-directory (no-littering-expand-etc-file-name "yasnippet/snippets"))) #+end_src *** Yasnippet snippets +:PROPERTIES: +:header-args:emacs-lisp: :tangle no +:END: Collection of snippets, activate after yasnippet has been loaded. #+begin_src emacs-lisp (use-package yasnippet-snippets -- cgit v1.2.3-13-gbd6f