Day 44 - Learning vim, installing plugins and spending time on tooling
02 Apr 2017 100daysofwriting · programming · technology · tools · vimSo, yesterday I wrote a couple of scripts. These are mainly to make the counting of the posts easier. Till now, in the month of march the post number was simply the date + 11, but now and going forward it will be pretty hard to keep track of this number and at the same time save a few keystrokes in opening the editor and typing the number in, removing the TODO tags from the template. Anyway, the ruby script was fun to implement. It probably doesn’t need to be this big(?), I just wanted to be sure that I would get the right date for the post on the first attempt itself and I won’t have to edit the name or something like that. You should keep working on tooling, until you feel good about everything that you have (which will never really happen)
This is exactly the approach I took to vim, I used to use Sublime Text full time until I decided to switch to vim. For the longest time (about 3 months), I used vim with absolutely vanilla settings, I spent no time at all on setting up my preferred keyboard shortcuts or installing plugins even though the vim plugin ecosystem was something everyone raved about.
But eventually, I found vimawesome, which is a very
pretty catalogue of all the plugins that are available for vim. I installed
Vundle, then I installed each of the plugins that I now have. I think
nerdcommenter
is a plugin that I really needed but couldn’t figure out how to
work for about a month, but then I scoured the readme, tried different key
combinations and then I finally understood the readme. The fault was all
mine really, I had no clue what the <leader>
meant back then.
There were some other plugins that came and went away quickly, NerdFileTree
was one of them, although I liked that, it couldn’t even compete with the
convenience and the sheer power of CtrlP
. CtrlP is my second favourite vim
plugin, and it’s also there everywhere else, any IDE, any text editor. A lot of
people surprisingly don’t know about this particular functionality and spend
quite a bit of time going around in their terminal or even more time
navigating around Nautilus. CtrlP exists: USE IT, you will LOVE IT
Right after those two plugins, I am going to put
vim-system-copy
which I installed very very recently and
vim-multiple-cursors
which again is a plugin that’s been installed for quite
some time, but I learned to use properly only a few months ago. Both these
plugins have made life even more easy for me! (Especially inside tmux
where
the tmux-yank
plugin has to be used to copy text. Yeah, unnecessary
complexity, I am sure there’s a good reason for that to be the case.)
Syntax highlighting, vertical and horizontal splitting of the screen into panes and all that common editor stuff is cool. TL; DR Spend a weekend getting vim to do what you want an editor to do for you, spend another weekend’s worth of time doing full time work with vim even if it is slow and painful as hell and requires a lot of searches in the browser, DO IT. Eventually, it will all be muscle memory and you will have picked up the amazing skill of being at ease no matter what computer is thrown at you.
I actually wrote a lot of the above paragraphs in a cover letter that I submitted for an internship position at Basecamp, for Summer 2017. I didn’t get in, I did get a phone interview with Noah Lorang (who happens to be the Data team head. WHAT?!) and I wonder if the person who was screening the cover letters was influenced by the couple sentences I wrote about how vim made me all powerful when I sat down at a new computer or ssh-ed into a droplet somewhere.
I have also had the pleasure / discomfort of using vanilla vim forcefully, I
always keep a basic vim configuration handy at this
gist,
who’s short URL is stored on my phone as a contact. You are probably thinking
that this is too convoluted, but it’s a really convenient setup. (wget short-url
when on a new computer)
POST #44 is OVER