{"id":2147,"date":"2019-07-04T16:04:55","date_gmt":"2019-07-04T20:04:55","guid":{"rendered":"https:\/\/www.thatsoftwareguy.com\/blog\/?p=2147"},"modified":"2019-07-04T16:04:57","modified_gmt":"2019-07-04T20:04:57","slug":"vi-brace-matching","status":"publish","type":"post","link":"https:\/\/www.thatsoftwareguy.com\/blog\/2019\/07\/04\/vi-brace-matching\/","title":{"rendered":"vi brace matching"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">For 40 years, brace matching in vi has been part of my workflow, and for the most part, it works great!  One of the first things I look for in a new editor is this feature.  But sometimes, it breaks down.  Consider a PHP line like: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">if (stripos($str, '{+') !== false) {<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">As soon as you do something like that, your brace matching in vim falls apart.  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But there&#8217;s a fix!  The incredible <a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/www.vim.org\/scripts\/script.php?script_id=39\" target=\"_blank\">matchit<\/a> mod for vim by <a rel=\"noreferrer noopener\" aria-label=\"Benji Fisher (opens in a new tab)\" href=\"https:\/\/twitter.com\/benji17fisher\" target=\"_blank\">Benji Fisher<\/a>.  Handles THOUSAND LINE if blocks (this is <strong>legacy<\/strong> code, my friends) like a knife through butter.  Thank you Benji! <\/p>\n","protected":false},"excerpt":{"rendered":"<p>For 40 years, brace matching in vi has been part of my workflow, and for the most part, it works great! One of the first things I look for in a new editor is this feature. But sometimes, it breaks down. Consider a PHP line like: if (stripos($str, &#8216;{+&#8217;) !== false) { As soon as &hellip; <a href=\"https:\/\/www.thatsoftwareguy.com\/blog\/2019\/07\/04\/vi-brace-matching\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">vi brace matching<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88,59],"tags":[],"class_list":["post-2147","post","type-post","status-publish","format-standard","hentry","category-php","category-software-engineering"],"_links":{"self":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/2147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/comments?post=2147"}],"version-history":[{"count":1,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/2147\/revisions"}],"predecessor-version":[{"id":2148,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/2147\/revisions\/2148"}],"wp:attachment":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/media?parent=2147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/categories?post=2147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/tags?post=2147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}