Why I Chose to Learn Vim

My Vim Journey and Why You Should Consider Learning Vim, TooPhoto by Ilya Pavlov on UnsplashWhy I Chose To Learn VimSince my introduction to the coding world, Visual Studio Code has been my go-to code editor. Throughout the past 1.5 years, I have gotte…

My Vim Journey and Why You Should Consider Learning Vim, Too

A computer screen with several lines of colorful code
Photo by Ilya Pavlov on Unsplash

Why I Chose To Learn Vim

Since my introduction to the coding world, Visual Studio Code has been my go-to code editor. Throughout the past 1.5 years, I have gotten to know all my favorite and most useful extensions. I learned several shortcuts for a more efficient coding experience. I used their integrated version control management system and connected it directly with my GitHub account. VS Code is fast, user-friendly, and can be tailored to your preferences.

I recently started a software developer apprenticeship program. When I received my new laptop in the mail (WFH life), one of the first tasks I completed was setting up my VS Code environment. Truthfully I never thought about trying another editor — why would I need to, right?

Transitioning to Vim

When deciding what to learn at the start of my apprenticeship, my mentor suggested Vim. I had never used Vim before, I thought. Well, it turns out I had encountered it — when there are merge conflicts that you need to fix in your code, a vim editor window will often open up in the terminal. I had experienced that and found myself very confused and unable to navigate it!

I read up a little on Vim before committing to it. No use of the mouse? That sounded scary! Specific commands and shortcuts you need to memorize? Wouldn’t that be too overwhelming while also learning a new coding language (Python)? I sat there and tapped into what I was feeling — fear of change, fear of the unknown, fear of failure. What if I couldn’t learn this new tool? What if it was “too hard”? And that’s when I knew I had my answer — learning Vim is the right way to go.

“Life always begins with one step outside of your comfort zone.” — Shannon L. Adler

I had almost allowed myself to give in to remaining in my comfort zone — what a boring place! So I committed to learning Vim. If you have ever found yourself wanting to learn more but are a little intimidated, I’ll share with you my experience here…

Reasons to Learn Vim

  • You’ve “mastered” your go-to code editor (e.g. VS Code) and want a new challenge
  • You are dependent on the mouse and find yourself struggling to navigate the terminal/command line
  • You are dependent on VS Code’s version control manager and aren’t as comfortable with git commands
  • To prepare yourself for a situation in which your specific code editor is not available to you
  • To impress 🙂

How to Get Started Learning Vim

While this article won’t get too deep in the weeds of setting up your local Vim environment, I will offer a few suggestions to get you started:

  1. Download Vim (I used Homebrew — brew install vim)
  2. Use a Vim Bundle manager like Vundle — there are a ton of useful plugins (like extensions in VS Code) that allow you to tailor your Vim experience
  3. Upgrade your terminal experience with iTerm2

How I Went About Learning Vim

There are a plethora of resources for learning Vim — whether it’s through YouTube, Vim’s built-in help center, or through a quick google search.

After downloading all the necessary tools and setting up your local environment, here are a few links and ideas to begin your Vim journey:

  1. The first task I completed was vimtutor. When you type vimtutor directly into the command line, you’ll be taken through a set of tutorials directly within Vim and this is a great place to get started!
  2. At any point while in the Vim editor, type :help
  3. Treat your learning like a game — I was directed to a website called Vim Adventures that allows you to learn how to navigate Vim through a video game-like experience.
  4. Think about your most used keystrokes or movements/actions — then see if there is a shortcut in Vim for this same command. For example, let’s say you want to delete 3 lines of code. Typing D will delete an entire line from your project. To delete these 3 lines, you could type D three times. You could also type 3D and with less thought and keystrokes, you’ve achieved the same result. You’ll find your flow with what feels most natural to you.
  5. The more you use the commands you’ve learned, the more they will become second nature to you. Commit to coding all your new projects exclusively in Vim. It may take you longer in the beginning, but the more you use it, the easier it will become.

Keep In Mind…

Practice. It’s one thing to read through help resources or the vimtutor lessons. It’s an entirely different thing to actively use the lessons. For every new command I learned, I returned to an open Vim window with a practice project and used the command multiple times. It’s important to get your hands on the keys and practice, to see what each command does in real-time. Ask yourself — does it behave the same way if I’m at the start of a line or the end? Does the command behave differently depending on where my cursor is? With a simple u, you can undo anything you’ve done so no harm in playing around!

Commit. Like most things in life, it takes commitment to learn a new skill. It might take you longer to code up a project in Vim than it would in your preferred editor. And that’s okay! Time-box your commitment to learning Vim — I prefer the Pomodoro method. The more you commit, the greater your returns.

Memorize (but not too much). In other words, nail the basics first. Try not to overwhelm yourself with memorizing all the possible commands. On a notecard, I wrote out 8–10 commands that I use most frequently and put the notecard next to my keyboard. Every time I found myself wanting to take that specific action, I confirmed on my notecard the shortcut. And before I knew it, I didn’t need the notecard anymore! Repeat as necessary with new useful commands as you progress.

Have Fun! No, really! Whether it’s playing Vim-Adventures or coding up a really simple project, learning is meant to be fun, exciting, and challenging.

I Leave You With This…

There are plenty of Vim cheat sheets out there. What worked for me was creating my own. Not only was I re-typing the commands to help solidify them in my memory, I now had everything I needed in one spot versus navigating to a few different websites. You can find my cheat sheet here.

If you’re committed to learning Vim, I would love to hear about it! Happy Coding!

Other Vim Resources I Found Helpful:

[1] https://gist.github.com/tuxfight3r/0dca25825d9f2608714b

[2] http://vimdoc.sourceforge.net/htmldoc/help.html

[3] http://robertames.com/files/vim-editing.html

[4] https://stackoverflow.com/questions/5400806/what-are-the-most-used-vim-commands-keypresses/5400978#5400978

[5] http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html

[6] https://www.moolenaar.net/habits.html

[7] https://www.barbarianmeetscoding.com/boost-your-coding-fu-with-vscode-and-vim


Why I Chose to Learn Vim was originally published in Level Up Coding on Medium, where people are continuing the conversation by highlighting and responding to this story.


Print Share Comment Cite Upload Translate
APA
Taylor Keazirian | Sciencx (2024-03-29T10:42:04+00:00) » Why I Chose to Learn Vim. Retrieved from https://www.scien.cx/2022/03/19/why-i-chose-to-learn-vim/.
MLA
" » Why I Chose to Learn Vim." Taylor Keazirian | Sciencx - Saturday March 19, 2022, https://www.scien.cx/2022/03/19/why-i-chose-to-learn-vim/
HARVARD
Taylor Keazirian | Sciencx Saturday March 19, 2022 » Why I Chose to Learn Vim., viewed 2024-03-29T10:42:04+00:00,<https://www.scien.cx/2022/03/19/why-i-chose-to-learn-vim/>
VANCOUVER
Taylor Keazirian | Sciencx - » Why I Chose to Learn Vim. [Internet]. [Accessed 2024-03-29T10:42:04+00:00]. Available from: https://www.scien.cx/2022/03/19/why-i-chose-to-learn-vim/
CHICAGO
" » Why I Chose to Learn Vim." Taylor Keazirian | Sciencx - Accessed 2024-03-29T10:42:04+00:00. https://www.scien.cx/2022/03/19/why-i-chose-to-learn-vim/
IEEE
" » Why I Chose to Learn Vim." Taylor Keazirian | Sciencx [Online]. Available: https://www.scien.cx/2022/03/19/why-i-chose-to-learn-vim/. [Accessed: 2024-03-29T10:42:04+00:00]
rf:citation
» Why I Chose to Learn Vim | Taylor Keazirian | Sciencx | https://www.scien.cx/2022/03/19/why-i-chose-to-learn-vim/ | 2024-03-29T10:42:04+00:00
https://github.com/addpipe/simple-recorderjs-demo