(Emacs)~yasnipet -> snippets
Now creating a system to use skeleton and abbrev to replace yasnippet
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user