DEV Community

Cover image for I've been using VIM for a Week - These Are My Impressions
Lucas Chitolina
Lucas Chitolina

Posted on

I've been using VIM for a Week - These Are My Impressions

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:

  1. 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: Vim As Your Editor - ThePrimeagen's playlist

  2. 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?

Image description

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.

Image description

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.

Image description

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 (32)

Collapse
 
ingosteinke profile image
Ingo Steinke

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.

Collapse
 
miketalbot profile image
Mike Talbot ⭐

100% this, vital in the real world.

Collapse
 
patfinder profile image
Le Vuong • Edited

ESC :q! -- everyone should know this :)

Collapse
 
ranjancse profile image
Ranjan Dailata • Edited

The majority of them will escape and never come back, lol

Thread Thread
 
sjsadv profile image
S.J.'s DIY Adventures

They're missing out.

Collapse
 
laxman67 profile image
Laxman

Escape without saving

Collapse
 
eljayadobe profile image
Eljay-Adobe

Bill Joy, the creator of vi, has pointed out:

...I was trying to make it [vi] usable over a 300 baud modem. That's also the reason you have all these funny commands. It just barely worked to use a screen editor over a modem. It was just barely fast enough. A 1200 baud modem was an upgrade. 1200 baud now is pretty slow.

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!)

Collapse
 
bahner profile image
Lars Bahner

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 💃

Collapse
 
thumbone profile image
Bernd Wechner • Edited

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).

Collapse
 
kylereeman profile image
KyleReemaN

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

Collapse
 
lucaschitolina profile image
Lucas Chitolina

That's what I'm discovering too, it's been a fun experience

Collapse
 
daelmaak profile image
Daniel Macák

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.

Collapse
 
stroud profile image
James Stroud • Edited

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.

Collapse
 
aditya_raj_1010 profile image
A.R

It's great to hear about your experience with Vim and your honest reflections on the learning process. Here are some thoughts and tips based on your article:

Reducing Mouse Use for Health Reasons: Your motivation to learn Vim to reduce mouse usage for health reasons is commendable. It's crucial to prioritize your well-being, and if Vim helps in achieving that, it's a valuable skill to have.

Starting with Editor Extensions: Recommending using editor extensions or plugins for those who are already using editors like VS Code or Webstorm is a practical approach. It allows users to ease into Vim commands gradually without a steep learning curve.

:- followback for more insightfull discussion

Collapse
 
anmolbaranwal profile image
Anmol Baranwal

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.

Collapse
 
sjsadv profile image
S.J.'s DIY Adventures

You should use it sooner. It's awesome.

Collapse
 
alxwnth profile image
Alex

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.

Collapse
 
aditya_raj_1010 profile image
A.R

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!

Collapse
 
aditya_raj_1010 profile image
A.R

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

Collapse
 
brandonwallace profile image
brandon_wallace

I think it is better to use Vim or Gvim to start out to get the real Vim experience. I recommend just using the basic Vim commands for a while and build up a .vimrc file little by little.

Collapse
 
bwca profile image
Volodymyr Yepishev

I had pain in my wrist to the point I could not do a push-up, in my case switching to trackball solved the problem completely.

As for Vim, I used it when I was low on RAM (or was it Vi, I don't recall). It's good if you have no access to something more advanced imo

Collapse
 
sjsadv profile image
S.J.'s DIY Adventures

I know vim because I know vi. I had to learn vi because that's what was available on the old multi-rack sized UNIX servers in the early days of my IT career.
Then emacs came along, so I tried it, and stayed with vim, because I found emacs archaic and difficult to use; despite how much all the emacs diehards complained about vim being archaic and difficult to use. Not to mention that I was still working on servers that only came with vi, and even Linux still came with vim as a default, especially on lightweight distros.
Even today, once you wrap your head around having an edit mode and an input mode, vim is very powerful and very easy to use; which is why it's still around, still a great tool, and why my first user profile customizations I always add to .bashrc is the line: set -o vi

Collapse
 
pedorro profile image
Sean Colgan • Edited

Best thing I ever did to make Vim even more fluid and useful - rebind the CapsLock key as another Esc. No more stretching with the left pinky for a key critical to the Vim workflow. Now it's right there, within easy reach. And I always thought CapsLock was pretty pointless anyway. Why devote such prime keyboard real estate to something that's almost never used.