Spacemacs Yasnippet for boilerplate code and often repeated text
Channel: Community Developer
Date: 2018-10-25

Discover more videos and books and motivate me to create more at https://practicalli.github.io/#support



Spacmacs includes yas-snippets, a template system to save you typing boilerplate code or often repeated test.

When typing the name of a snippet you can press tab to expand it into its full text.

I have snippets added to autocomplete so when I start typing I may see multiple matches in the autocomplete popup.  I can TAB through the options and press RET to select a snippet.

If the snippet contains markers, defined by $1, $2, etc.I can just to the next using TAB.  $0 is the end mark, so this is where mu cursor will end up after tabbing.

You can also edit a snippet using `SPC SPC yas/visit-snippet-file`.  You are prompted with a helm menu to help you find the snippet.  Selecting the snippet will open it in a new buffer for editing.  Using `C-c C-c` will save the changes and reload the snippet.

https://practicalli.github.io/spacemacs/