{"id":2211,"date":"2013-10-14T05:34:04","date_gmt":"2013-10-14T09:34:04","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=2211"},"modified":"2013-10-14T05:47:07","modified_gmt":"2013-10-14T09:47:07","slug":"using-yasnippet-to-reduce-blogging-friction","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=2211","title":{"rendered":"Using <code>yasnippet<\/code> to Reduce Blogging Friction"},"content":{"rendered":"<p>Every Irreal blog post begins with some header information that tells <code>org2blog<\/code> the title, category, and tags for the post. These get communicated to WordPress when <code>org2blog<\/code> exports the post. Those lines look like this:<\/p>\n<div class=\"org-src-container\">\n<pre class=\"src src-org-mode\">#+TITLE: Using =yasnippet= to Reduce Blogging Friction\r\n#+CATEGORY: Blogging\r\n#+TAGS: Emacs<\/pre>\n<\/div>\n<p>There are 862 posts on Irreal at the moment and everyone of them begins with those 3 header lines. That&#8217;s a lot of typing, especially with all the capitalization. (Yes, yes, I know all about <code>upcase-word<\/code> and in fact I type them in lower case and then use \u3010<kbd>Meta<\/kbd>+<kbd>b<\/kbd> <kbd>Meta<\/kbd>+<kbd>u<\/kbd>\u3011 to capitalize them\u2014it&#8217;s still a lot of typing.)<\/p>\n<p>I finally reached the end of the rope and decided that it was past time to install <code>yasnippet<\/code> so that I could automate that. After some floundering around, I figured out how to get snippets to load with Org Mode and added this snippet:<\/p>\n<div class=\"org-src-container\">\n<pre class=\"src src-emacs-lisp\"># -*- mode: snippet -*-\r\n# name: header\r\n# key: bh\r\n# --\r\n#+TITLE: $1\r\n#+CATEGORY: ${2:General}\r\n#+TAGS: $3<\/pre>\n<\/div>\n<p>Now when I start a post, I begin with <code>bh<\/code> \u3010<kbd>Tab<\/kbd>\u3011 and the header skeleton is automatically inserted. I know I&#8217;m late to the party on this. Everyone else is already using <code>yasnippet<\/code> and wondering what took me so long.<\/p>\n<p>All this probably isn&#8217;t going to save me huge amounts of time but it does reduce blogging friction a bit so it&#8217;s a win. Now that I have <code>yasnippet<\/code> installed I&#8217;ll be looking for other ways to leverage its power.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every Irreal blog post begins with some header information that tells org2blog the title, category, and tags for the post. These get communicated to WordPress when org2blog exports the post. Those lines look like this: #+TITLE: Using =yasnippet= to Reduce &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=2211\">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":[6],"tags":[18],"class_list":["post-2211","post","type-post","status-publish","format-standard","hentry","category-blogging","tag-emacs"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2211","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=2211"}],"version-history":[{"count":2,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2211\/revisions"}],"predecessor-version":[{"id":2213,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2211\/revisions\/2213"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}