A YASnippet Tutorial

Matthew Keeler has posted a nice introduction to writing YASnippets. Keeler starts with a minimal snippet that simply includes the GPL 3 boiler plate in the file and then moves on to a for loop snippet for C/C++ that uses tab stops.

Finally he presents a couple of complex examples. The first uses mirrored fields to build C++ QT classes. It also demonstrates embedding Elisp code in the snippet. A second example ties everything together to build a snippet for defining a PHP class.

Writing snippets is pretty easy once you’ve seen a couple of them explained. Keeler’s post is a nice way to get started.

This entry was posted in General and tagged . Bookmark the permalink.