Josh Larson

Challenge: A Week with Vim

I go on a week-long challenge to only use Vim as my text/code editor. Goodbye, Sublime Text! See you never! Totally kidding.

...

A while back, I wrote about what developer tools I use. Among those tools is the bread and butter of my arsenal: Sublime Text 2.

While I love Sublime Text, and alternatives like Atom¬†and the shiny, new Visual Studio Code look great, I’ve been wanting to learn something I’ve been putting off for a long time: Vim.

I’d like to think learning Vim would help me¬†level me up as a developer, though I don’t know if that’s true. Maybe it would just make me super frustrated. Regardless, I’m going to go on a one-week #vimchallenge to only use Vim for all development¬†projects – even at work!

Here it goes:

Day #1: Sunday

I’m feeling nervous. Don’t know if I’ll be up for the challenge.

To begin, I read a quick tutorial on Scotch.io which helped explain the basics, like opening and closing documents and navigating around the windows.

Next, I tried to parse through one of my Twitter friend’s¬†.vimrc file on Github. Yep, way¬†over my head at this point. Since I’ve never really used Vim (purposefully) before, I don’t know what those plugins do nor how indenting¬†works exactly.

Here are a couple questions so far:

  • Do I need NerdTree to do some basic file explorer things?
    • Of course, when I do a quick search for NerdTree, one of the first results is “You Don’t Need NerdTree,”¬†just use this other complicated thing instead. I think I’ll avoid it altogether for now.
  • In Sublime/Atom, I use CMD + P all the time. How can I¬†do that in Vim?
    • A quick¬†Google search leads me to this tool, but I’m pretty sure it’s written in a foreign language (not really – I just don’t know what anything on the page means)
    • No answer so far.

OK, I’m gonna continue working on an application¬†using Vim. My Vim Cheat Sheet is ready!

Update

OK, I gave in and¬†installed Pathogen and NERDTree. Once I learned how to switch between windows (CTRL + ww) and between tabs (gt), I’ve been much more productive.

Update 2

I installed Vundle instead and then re-installed NERDTree. Vundle seems like it’s more up to date. But who knows – maybe it’s like one of those Brew vs MacPorts debates.

Vim on Day 1

I’m a professional developer!

 

Day 2: Monday

To be honest, using Vim exclusively for a week at work scares me. I like to be as quick as possible when knocking out changes to a website design or scaffolding out a new PHP class in a WordPress plugin. And Vim seems like it¬†can’t wait to throw a wrench in my workflow.

Nonetheless, I’ve made it to noon. So far, so good.

Looking at Stripe Docs

Looking at Stripe and Easy Digital Download integrations. Fun, huh?

One thing I would really like is a fuzzy file finder (CMD + P in Sublime et al). Vim/NERDTree has some split screen action out of the box (and¬†maybe tabs, too). But I’m not much of a split-screen guy. I usually spend my time opening new tabs using the fuzzy file finder tool¬†while having the persistent file navigation at the left (though I don’t often use it).

Enter: CtrlP! Looks like this exists, and it’s pretty snazzy. Totally installed it.

Another thing I’m confused about is buffers vs tabs vs windows. What¬†do they all mean? Since I’m used to opening tabs in Sublime Text, I’ve been tempted to do the same in Vim. However, I’ve been reading¬†about how that’s not the right thing to do.

A simple search for “vim tabs vs buffers” led me to this helpful explanation. I’ll try using the buffergator tool he mentions and refrain from using tabs.

Day 3: Tuesday

Whomp. As you can see in my tweet above, I had to give in and use Sublime Text in order to get some quick work done.

I did start out my Tuesday back in Vim, though. Some things are really starting to bug me. Namely,¬†when I’m opening up new buffers after using CtrlP or Buffergator, they start auto-splitting¬†in my current window after a while instead of¬†filling in the current content area. I don’t know if it’s some key combination I’ve accidentally toggled, but it’s annoying.

And sometimes when using NERDTree, the window does a 50% split instead of¬†the normal sidebar-ish split ‚Äď again for no apparent reason.

I made it a couple hours, and then switched back to Sublime on Tuesday.

Days 4, 5, 6 and 7

As you might be able to guess, I simply didn’t make it a whole week in Vim. Thinking back, I’m glad I didn’t originally try to¬†do a whole month!

Every time I struggled and¬†fumbled around with Vim, I though, “You know, there’s a reason¬†people invented IDEs and code editors.”

I am one of those reasons, and my struggles with Vim are all of those other reasons.

So for now, I’m sticking to Sublime Text at work and¬†adapting to Atom at home. Peace!