{"id":5534,"date":"2016-09-14T15:02:00","date_gmt":"2016-09-14T19:02:00","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=5534"},"modified":"2016-09-14T15:02:35","modified_gmt":"2016-09-14T19:02:35","slug":"abrams-on-yasnippet","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=5534","title":{"rendered":"Abrams on Yasnippet"},"content":{"rendered":"<p> Howard Abrams over at <a href=\"http:\/\/howardism.org\/\">howardism.org<\/a> has posted a very nice <a href=\"http:\/\/howardism.org\/Technical\/Emacs\/templates-tutorial.html\">tutorial on yasnippet<\/a>. I learned a couple of things I didn&#8217;t know so you may find it worth a few minutes too. <\/p>\n<p> First off, I was only dimly aware that you can bring up a template for a new snippet with \u3010<kbd>Ctrl<\/kbd>+<kbd>c<\/kbd> <kbd>Ctrl<\/kbd>+<kbd>n<\/kbd>\u3011. What&#8217;s really nice is that the template is a snippet so you can tab through it filling in the fields like any other snippet. I always have to copy an existing snippet into my buffer to get all the boiler plate. This is a lot easier. <\/p>\n<p> More importantly, Abrams shows us how to use <code>yas-expand-snippet<\/code> to treat any text as a snippet even if it hasn&#8217;t been added to the snippet collection. That may not seem like much but it turns out to be tremendously useful. Abrams gives an interesting use case where he combines <code>auto-insert<\/code> with <code>yas-expand-snippet<\/code> to fill in the boiler plate at the top of many programming files. <\/p>\n<p> It&#8217;s a good tutorial and well worth taking a look at. It shows some of the power of yasnippet that you may not know about. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Howard Abrams over at howardism.org has posted a very nice tutorial on yasnippet. I learned a couple of things I didn&#8217;t know so you may find it worth a few minutes too. First off, I was only dimly aware that &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=5534\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[18,116],"class_list":["post-5534","post","type-post","status-publish","format-standard","hentry","category-general","tag-emacs","tag-yasnippet"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5534"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5534\/revisions"}],"predecessor-version":[{"id":5535,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5534\/revisions\/5535"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}