{"id":166,"date":"2020-07-09T12:00:00","date_gmt":"2020-07-09T16:00:00","guid":{"rendered":"http:\/\/mattrobertson.ca\/blog\/?p=166"},"modified":"2020-07-08T20:39:44","modified_gmt":"2020-07-09T00:39:44","slug":"six-months-of-vim","status":"publish","type":"post","link":"https:\/\/mattrobertson.ca\/blog\/2020\/07\/09\/six-months-of-vim\/","title":{"rendered":"Six Months of Vim"},"content":{"rendered":"\n<p>The start of 2020 wasn&#8217;t the first time I tried to switching to Vim, but it <em>was<\/em> the first time it stuck. I should mention that I&#8217;m not &#8220;good&#8221; at Vim: I never use <code>:grep<\/code> or <code>:!<\/code>, my <code>.vimrc<\/code> is basic as hell, I don&#8217;t use macros or plugins at all, only use the default buffer, and I&#8217;ve never learned how to properly copy things into\/out of Vim. I have, however, gotten to a point where I&#8217;m pretty comfortable using Vim in my day-to-day, to the point where it&#8217;s my primary editor.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Getting into things<\/h3>\n\n\n\n<p>What ended up getting me to make the full switch was, somewhat weirdly, just going all in on it for a couple days. I had made the realization shortly before then that I didn&#8217;t really make use of any of the power features present in what was then my editor of choice (<a href=\"https:\/\/www.sublimetext.com\/3\">Sublime Text 3<\/a>, for those curious): I used ReGeX search a ton, ctrl+p to open files, and that&#8217;s about it. So, armed with the knowledge that I wouldn&#8217;t actually be slowing myself down by using Vim, I grabbed the Vim plugin <a href=\"https:\/\/github.com\/ctrlpvim\/ctrlp.vim\">Ctrl+P<\/a> (I&#8217;ll come back to this in a second) and resolved to just not open Sublime Text for the week, just to see how it went. Evidently, it went well.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Taking Notes and Learning<\/h3>\n\n\n\n<p>One thing rather different about this attempt at learning Vim was how I went about learning new commands\/tricks. In extremely &#8220;me&#8221; fashion, I&#8217;d always dive far too deep far too quickly, get overwhelmed, and give up. This time around, I did two things differently:<\/p>\n\n\n\n<p>1) I decided I wouldn&#8217;t just look up &#8220;useful vim tricks&#8221; or anything of the ilk. I&#8217;d look up a solution to a specific problem I was having (mostly, being annoyed at how slow an action seemed to be), or I wouldn&#8217;t look anything up at all.<\/p>\n\n\n\n<p>2) Any time I found a useful new tip, I&#8217;d write it down in my <a href=\"https:\/\/github.com\/matthew-robertson\/Useful_things\/blob\/master\/I%20Learned%20Something%20Today\/Vim.md\">personal wiki<\/a>, to remember later. To that point, before I&#8217;d google how to do something, I&#8217;d check if I had already written it down before. The frequency with which I&#8217;d forget I already had the answer to my question was astounding, and this has been useful for far more than just expanding my Vim skills.<\/p>\n\n\n\n<p>The result was that I didn&#8217;t overwhelm myself with the seemingly infinite depth of Vim, but did slowly get better at using the tool.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Plugins<\/h3>\n\n\n\n<p>Let&#8217;s take that pin out of <a href=\"https:\/\/github.com\/ctrlpvim\/ctrlp.vim\">Ctrl+P<\/a> usage now. When I first switched, I thought it was incredibly important for me to have fuzzy file searching and file jumping in my tool. I looked up all the popular plugins for it (<a href=\"https:\/\/github.com\/preservim\/nerdtree\">NerdTree<\/a>, <a href=\"https:\/\/github.com\/ctrlpvim\/ctrlp.vim\">Ctrl+P<\/a>, etc\u2026), picked one, and off I went. Within two weeks, I had completely stopped using it and now I live my Vim life plugin free.<\/p>\n\n\n\n<p>Most of my move away from Ctrl+P was spurred on by embracing the (Bash philosophy) a bit more, and getting into using <code>find<\/code> and <code>grep<\/code> more to look around for what I was looking for. Part of it was being introduced to this talk about <a href=\"https:\/\/www.youtube.com\/watch?v=XA2WjJbmmoM\">replicating plugins with pure Vim<\/a>, which I found when rather frustrated with some performance issues I was having with Ctrl+P.<\/p>\n\n\n\n<p>The last, and maybe most useful factor in my switch away from plugins was learning how buffers, splits, and tabs work (note, I still barely know what I&#8217;m doing here). Which took\u2026 a while. For a while, I made the mistake of using Vim tabs like I should have been using buffers. Since I&#8217;ve changed that, I&#8217;ve felt <em>way<\/em> more productive. I might write my own take on things at some point, but until then take a look at <a href=\"https:\/\/dev.to\/iggredible\/using-buffers-windows-and-tabs-efficiently-in-vim-56jc\">these<\/a> <a href=\"https:\/\/stackoverflow.com\/questions\/26708822\/why-do-vim-experts-prefer-buffers-over-tabs\">posts<\/a> about using the various views.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Where Now?<\/h3>\n\n\n\n<p>Honestly, I&#8217;m kind of in a comfortable spot, and I&#8217;m not in a huge rush to get much &#8220;better&#8221; at Vim. Sooner rather than later I&#8217;d like to get more comfortable manipulating named buffers, and I&#8217;d certainly like to slowly make <a href=\"https:\/\/github.com\/matthew-robertson\/dotfiles\/blob\/master\/.vimrc\">my vimrc<\/a> more useful, but there aren&#8217;t (or at least don&#8217;t <em>feel<\/em> like there are) any glaring deficiencies in my workflow. So, for now, I take it slow.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The start of 2020 wasn&#8217;t the first time I tried to switching to Vim, but it was the first time it stuck. I should mention that I&#8217;m not &#8220;good&#8221; at Vim: I never use :grep or :!, my .vimrc is<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[2,3,4],"class_list":["post-166","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-development","tag-tooling","tag-vim"],"_links":{"self":[{"href":"https:\/\/mattrobertson.ca\/blog\/wp-json\/wp\/v2\/posts\/166","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mattrobertson.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mattrobertson.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mattrobertson.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mattrobertson.ca\/blog\/wp-json\/wp\/v2\/comments?post=166"}],"version-history":[{"count":4,"href":"https:\/\/mattrobertson.ca\/blog\/wp-json\/wp\/v2\/posts\/166\/revisions"}],"predecessor-version":[{"id":174,"href":"https:\/\/mattrobertson.ca\/blog\/wp-json\/wp\/v2\/posts\/166\/revisions\/174"}],"wp:attachment":[{"href":"https:\/\/mattrobertson.ca\/blog\/wp-json\/wp\/v2\/media?parent=166"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mattrobertson.ca\/blog\/wp-json\/wp\/v2\/categories?post=166"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mattrobertson.ca\/blog\/wp-json\/wp\/v2\/tags?post=166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}