The buzz cut

Ramblings from the barbershop

A Month With Vim: Week 2

| Comments

Week two of my Vim experiment began and ended with me doubting whether Vim was really a better editor than Sublime Text. However, in the middle of all that doubt something interesting happened: I became reliant on Vim. Yes, you read that right. While I was doubting Vim, I was unknowingly becoming addicted to it. It’s almost as if Vim was cackling in the corner, saying “it’s so cute that you think you have a choice.”

Honestly, at the beginning of the week, I really wanted to abandon the entire experiment. I was losing productivity, tripping over simple things, and really starting to think that Vim was more about a nerd badge than anything else. I started to bounce questions off a few people who swear by Vim, and even sat and watched one of them code for fifteen minutes. He flew through some routine refactoring, which was certainly encouraging. I shared with him what I’d learned so far and he told me that I was close, and to keep at it.

Sometime during the week, I encountered the Yank command while playing Vim Adventures. I sat down to code that day and quickly ran into a situation where I needed to Yank something. Unfortunately, in my mind, “Yank” meant “deleting and copying.” Yes, that’s what the delete command does, however at the time, I thought the delete command simply deleted it (without copying). So, I tried to “Yank” some text, and nothing happened — nothing was deleted. This began two hours of misery. I googled and googled, but found nothing useful. I tried reverting my .vimrc, thinking maybe there was a conflict with one of my configs. I tried visual mode. I tried Y and y{motion} a hundred times, hoping that suddenly it would start working. Then I posted to Stack Overflow. Within ten minutes, someone had explained that Yank simply copies. Whoever named that command Yank, instead of Copy, deserves a kick in the ribs.

I share that story for two reasons. Firstly because annoyances like that seem to pile up quickly with Vim. Even the obvious things can be difficult at first. Secondly, it’s those frustraing moments where I tend to learn the most. While I was hacking away, trying to solve my problem, I stopped thinking about “using Vim.” I just used it. It was during those two hours where I really began to develop some muscle memory around the Vim commands and motions.

By mid-week, I spent some more time beautifying things. I switched to the solarized theme, and installed an awesome status line utility called powerline. Powerline changes the color of the status line depending on which mode you’re in, which I found super helpful. It was also around this time that I noticed I was starting to move quickly and make fewer mistakes. Switching between normal mode and insert mode was becoming more and more natural, I was moving around files faster, and getting a hang of the commands and motions. It wasn’t life-changing, but it did feel like I was interacting with my computer on a more intimate level. Like, I had gone from writing code using the same keystrokes that I’d use in MS Word, to writing code with keystrokes that felt more approrpiate to a programmer.

Feeling good about things, I started to experiment more with Vim plugins. I found this Quora question to be the most succinct list of the most popular Vim plugins. The more I played with the plugins though, the more I thought that what took plugins and configurations with Vim, came out-of-the-box with Sublime Text. Should we really be high fiving each other because we can change ‘foo’ to “foo” with the Surround plugin? And do I really have to remember to type cs'“ to do that, when in Sublime Text, I just highlight the word and type ?

Late in the week, I ran into a situation where I needed to quickly answer something for a client. I broke down and opened up Sublime Text 3 (shh, don’t tell anyone). After answering the question, I looked lovingly at my beautiful, familiar text editor, and began to… CHEAT. I was ready to go back to Sublime Text. I was happy that I’d learned Vim, but ready to declare Sublime Text the victor. And then my world got turned upside down. I couldn’t move around Sublime Text. Not because I couldn’t remember the key commands, but because the ones I wanted weren’t there. My mind was telling me that I liked Sublime Text, but my fingers were telling me that I liked Vim. Fan-fucking-tastic.

I discovered that Sublime Text has a “vintage mode” where you can enable a lot of the Vim commands and motions. I thought maybe that’d be a happy medium. But happy mediums are never really happy, are they? Nothing felt right about vintage mode. The solution was either full Vim, or full Sublime Text.

So, here I am, at the end of week two, a bit confused. I’m in no man’s land — no longer in love with Sublime Text, but not ready to declare my love for Vim. Let’s hope Week 3 provides some clarity!

Comments