{"id":2073,"date":"2013-08-18T08:38:51","date_gmt":"2013-08-18T12:38:51","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=2073"},"modified":"2013-08-18T08:38:52","modified_gmt":"2013-08-18T12:38:52","slug":"my-solution-to-the-latest-vimgolf-challenge","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=2073","title":{"rendered":"My Solution to the Latest VimGolf Challenge"},"content":{"rendered":"<p> Readers contributed many good solutions to this challenge. The mundane solution involves using <code>query-replace-regexp<\/code> with regular expressions <\/p>\n<pre class=\"example\">\n\\(w+\\) \u2192 (\\1)\n<\/pre>\n<p> for 14 keystrokes or, if you&#8217;re a bit more clever <\/p>\n<pre class=\"example\">\nw+ \u2192 (\\&amp;)\n<\/pre>\n<p> for 10. Actually, I have <code>electric-pair-mode<\/code> enabled so my counts were 13 and 9 but the 14 and 10 counts work for a stock Emacs. <\/p>\n<p> My best solution was much like those contributed by readers <\/p>\n<table border=\"2\" cellspacing=\"0\" cellpadding=\"6\" rules=\"groups\" frame=\"hsides\">\n<colgroup>\n<col  class=\"left\" \/>\n<col  class=\"left\" \/> <\/colgroup>\n<tbody>\n<tr>\n<td class=\"left\">\u3010<kbd>F3<\/kbd>\u3011<\/td>\n<td class=\"left\">&#xa0;<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">\u3010<kbd>Meta<\/kbd>+<kbd>(<\/kbd>\u3011<\/td>\n<td class=\"left\">;; paredit-wrap-round<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">\u3010<kbd>Meta<\/kbd>+<kbd>Ctrl<\/kbd>+<kbd>n<\/kbd>\u3011<\/td>\n<td class=\"left\">;; paredit-forward-up<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">\u3010<kbd>Ctrl<\/kbd>+<kbd>f<\/kbd>\u3011<\/td>\n<td class=\"left\">;; forward-char<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">\u3010<kbd>Meta<\/kbd>+<kbd>0<\/kbd>\u3011<\/td>\n<td class=\"left\">&#xa0;<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">\u3010<kbd>F4<\/kbd>\u3011<\/td>\n<td class=\"left\">&#xa0;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> Sadly, my mind appears to be undergoing bit rot. As <a href=\"https:\/\/github.com\/Fuco1\/\">Fuco<\/a> points out, I&#8217;ve posted this problem <a href=\"http:\/\/irreal.org\/blog\/?p=1953\">before<\/a>. You can check the comments to that post for a bunch of other solutions. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Readers contributed many good solutions to this challenge. The mundane solution involves using query-replace-regexp with regular expressions \\(w+\\) \u2192 (\\1) for 14 keystrokes or, if you&#8217;re a bit more clever w+ \u2192 (\\&amp;) for 10. Actually, I have electric-pair-mode enabled &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=2073\">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],"class_list":["post-2073","post","type-post","status-publish","format-standard","hentry","category-general","tag-emacs"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2073","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=2073"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2073\/revisions"}],"predecessor-version":[{"id":2074,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2073\/revisions\/2074"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}