Since we are programmers, there are a lot of different things to learn. Some of these things are career essentials and others are non-essential things that can add to our work in different ways.
Vim is one of these things.
In this article, I'm going to share my experience, how I'm feeling in these first few days, this kind of thing... Let's start with two important disclaimers:
I will not teach what is VIM or how to use it. As says in the title, is been a weekend since I started, so I don't know how to teach somebody. Instead, watch this:
I don't think a true coder is the one who uses VIM, terminals, and old programming language (the stereotype of a VIM fan). In my career, I've seen many good developers who don't even know what is VIM and they can deliver an outstanding job.
Having said that, let's get started.
So, why VIM?
Vim is pretty old and its uses cause a long debate. My main motivation for learning VIM is to reduce mouse use, even my mouse being an ergo one, I feel a lot of pain in my wrists, a kind of burning in my hand. The pain gets worse as the week goes on. I think that a life with the less use of mouse as possible will be better for my wrist and my productivity, so, this is my main goal with this whole thing.
Don't start directly with vim, instead, use your editor extension
You don't need to dive in head-first to start this. If you use VS Code, Webstorm, or any other editor that supports VIM plugins or extensions, go to this way. This will drastically reduce your barrier to entry and will help you stick to it.
You will discover that learning VIM is fun
I don't know if this happens to everyone, but I love to learn a new thing (if it will be useful too, it's a perfect match!). Learning how to use VIM motions is teaching me about my coding habits and showing me better ways to do the things I'm used to.
Not everything is flowers
However, the transition hasn't been entirely smooth. Initially, I found the different modes to be a significant shift from the typical text-editing experience. Remembering the commands and getting used to not reaching for the mouse took deliberate effort and got me stuck sometimes. The worst part was (and continues to be) cutting and pasting text, a seemingly simple task, was the one that I stumbled the most, sometimes resulting in lost code or duplicated lines.
These moments were good to show that the learning curve on how to use VIM in the best way is still enormous.
You need to have a cheat sheet by your side
This is one of the best pieces of advice that I can give to someone in this topic. Like in the old days when I was at school learning how to code in C, the teacher wrote the language commands on the board so that we could learn as we were coding. I tried to rescue this technique and I always have an Obsidian file opened so I can quickly check a command when I get stuck.
You don't need to optimize everything
Again, the fun of learning something is to keep making mistakes until a better path emerges and you realize what you were doing wrong so you can make better use of the good side of what you learned. You don't need to optimize everything. Try to achieve a moment that you can feel comfortable with your tools and environment.
Stick to what you is used to
If learning VIM starts to impede your workflow significantly, it's okay to revert to your familiar setup. The goal is to integrate VIM into your workflow without compromising your efficiency or the quality of your work.
Your job is to deliver value not learn how to type better
While learning VIM is very common to be stuck in something or do wrong or even slower things while you are learning the best mode. Like in Chess, you need to have time to do the wrong things to figure out what are the best things.
Even if you think "But indirectly, if I type faster or be more productive, they (customer, leader, team) will care about it, of course, it is important to them". Yes, that is but it is something that must be done indirectly, without concentrated effort to do so.
If you feel that you are stuck or delivering your job slower, stop, take a rest, exit VIM plugin and just code the way you are used to. This will be better because you can still learn and still deliver value. Remember: your boss, your team or your customer don't care the way you type things in the computer, they need value.
Final thoughts
And you? Do you use VIM? Want to join me in this? Have more tips to share with the ones who want to enter this world?
Feel free to share your comments below:
Top comments (33)
Another good reason, to learn vi(m) basics, is that it's virtually everywhere. You might find some minimal embedded systems or Docker images that use simpler console editors, and you will love vim in comparison. When you're not using an IDE but login to a remote server via shell and try to resolve a git conflict after pulling an update, you might find that vi has been set as the default editor, and using Esc, x, j, k, yy, p, dd can help you get your task done quickly.
100% this, vital in the real world.
ESC :q! -- everyone should know this :)
The majority of them will escape and never come back, lol
They're missing out.
They have to go back to read the document for basic ideas or "never come back" :)
Escape without saving
Bill Joy, the creator of vi, has pointed out:
The impetus for making vi was to minimize bandwidth usage of a very slow connection. Which is why vi (and Vim) have a sparse interface, and make the most out of the short keystroke sequences for input. And its modal states.
Bill Joy has said there is no reason to use vi anymore. We've got blazing fast machines, high bandwidth connections, graphical user interfaces, gobs of memory, huge hard drives. There are better editors out there.
Yet... I use vi (i.e., Vim) to this day. And I was late to the vi party, because I was an emacs user until the late 1990s.
Why? WHY? Well... because I find the editor gets out of my way so I can focus on the code. It's a zen-like experience where I am one with the keyboard and my document.
I never had that with emacs. That editor was always in my way, and always a distraction because I'd go down the shiny-object-syndrome rabbit hole of doing something snazzy with Emacs Lisp — and not working on what I was supposed to be working on.
So for all those people who are tempted to use Vim I can definitively say, "It's too late for me! Save yourselves!" (But if you still want to use Vim, there are a lot of us. And we're helpful. Have fun with VIM Adventures to get you started!)
I use vim in tandem with code. Since code pick up the changes I make, unless they overlap, I can use both at the same time. And I do. I often run vim in the code terminal, because it's just sooo must faster and easier for a lot of tasks.
But I don't install more than a few plugins (syntastic and gnupg). I couldn't be bothered with fiddling around with it.
I don't consider vim a good IDE, but a killer text editor.
And it's just so nice to know, than whenever you login somewhere, it's just there. So think of it as a plugin itself 💃
I was weened on vi in the '80s and so am familiar with it and it's on any and every headless *nix system out there, so invariable, because I never bothered with emacs or liked nano, I use vi still (which is vim nowadays).
For me, it's not just about being able to type faster or move around my codebase quicker, it's also that it's a lot more fun for me to program with Vim plugins
That's what I'm discovering too, it's been a fun experience
I have been using VI/Vim since 1993. There is no substitute. Even when I use an IDE as part of my workflow, I edit in Vim.
One time I had a job interview that required I code in a GUI editor. It was cumbersome and I think they thought I was bad at coding because it was generally hard to express myself.
A GUI editor is like playing the kazoo when you are used to a Stradivarius.
As with every other tool, it's important to use (n)vim for the right reasons. The argument that it's going to make you faster is a fallacy. Yes, if you are proficient, you probably are slightly faster in code writing and editing than your colleagues who use a mouse, but imo this is completely irrelevant to my job as a dev.
For me, Nvim is about convenience, however counterintuitive it might be on the first look. I enjoy the efficiency of navigating the code while my hands don't leave the keyboard. It's almost a lifestyle, once you start with Vim, you wish to use it everywhere. In IDEs, browser, notepad, you name it. Once you start seeing patterns of how easy it is to jump through text, it's hard to go back.
Vim is also fast and relatively lightweight, which allowed me on many occasions save precious memory where resources were limited due to local-heavy development.
As for tips, I recommend getting comfortable with Vim in private, ideally on a pet project, or even use it just for writing, eg. in Obsidian. Once you feel pretty good about your skills and your setup, where I'd argue the latter is more important, only then take it to the professional world. It seems like a small step, but I experienced quite a lot of pressure to recall all the Vim stuff I learned in "real world" settings, and I found my Vim setup was lacking in some places as well. If you feel like you are not coping, just switch to your old IDE and don't sweat it. Vim should be first and foremost fun for you so that you stay with it long term, and believe me it takes a lot of time to learn it, get used to it and feel confident working in it.
I learned about Vim three years ago while studying C through a course at UC Santa Cruz. The instructor was using it at the time. Since then, I haven't used it myself, but I know many people who do.
Although I prefer GUI interfaces, I will definitely use Vim later in my career.
You should use it sooner. It's awesome.
A mini-challenge I’ve set for myself is to use vim instead of nano to edit configs and such. So far so good! The more I use it, the more I’m starting to see why so many people love it.
That's fantastic to hear that you've taken on the mini-challenge of using Vim instead of nano for editing configs! It's a great step toward incorporating Vim into your daily workflow. As you continue to use it, you'll likely discover more of its powerful features and understand why it has such a dedicated user base.
Vim's modal editing and extensive keyboard shortcuts can be a bit overwhelming initially, but the more you practice, the more intuitive it becomes. It's excellent that you're already seeing the appeal. If you ever come across specific challenges or have questions about Vim commands, feel free to reach out. Many resources and communities are available to support your Vim journey.
Keep up the good work, and enjoy exploring the efficiency and flexibility that Vim brings to your text-editing tasks!
How has your experience been transitioning to VIM after a week of use? Have you encountered any challenges or found specific benefits to your workflow? Additionally, for those considering diving into VIM, what tips would you share to make the learning process smoother and more enjoyable?
followback for more insightful discussion