You should know how to Vim

How a text editor can change the way you think

Robertoplazaromero
4 min readJan 11, 2022

The common concern about Vim is that is either the tool for DevOps or SysAdmins or the tool for Hipster Developers, and that is the case on many ways, but there's more to it than meets the eye. Here's a list of reasons I hope will persuade you to, at the very least, learn the basics of Vim.

Personal experience with Vim

First things go first, I'm no one to tell you what tools to use, but, perhaps your story is similar to mine.

I've been working as a Software Developer (mostly backend) and also doing my share of DevOpsy stuff. For almost 3 years I've been using VSCode for evertything (even game development!!), about a year ago I setup a Vim config and I'm not going back.

Disclaimer, on my mind a pure software developer (especially Java software developers) should use and learn how to use the premium features of IntelliJ and derivates (Rider + Resharper is lit 🔥). The amout of tools those IDEs offer you is just out of the window.

First reason: It's the King of minimalism

The first experience of opening a file or project in Vim is quite different to the one you get by opening that very same thing in VSCode. The latter will immediately asks you for permissions, install extensions, configure settings and run commands for you. Vim, on the other hand just opens a file as any editor should do.

That is the first reason, it just works. every other text editor out there packs (on the surface) the same amount of utilities as Vim before beefing it up with plugins. Even better, Vim has some (low-quality) auto-complete with <C-n> and <C-p> in insert mode out of the box. Thou, it just hits you everything vim considers a token. But hey, better than nothing!

Given that the minimum amount of features is the same I'll rather just go with the editor that can be used with practically zero hardware requirements than with the one that requires a graphic display, 3–5x as much disk space and 2–3x the memory consumption.

Second reason: You are the one who tailors the experience

Buttons bother me. Every button you see in a program and don't use is a use case that the designers thought was important and you are not using. Let's be real the most visible buttons in those IDEs are not the most used or the most important tools they have to offer.

There is no visible button for auto-complete suggestion or file fuzzy finder in neither VSCode nor IntelliJ. They are all shortcuts. Why? Because they are important, and if they are important they should be quickly to access and shortcuts are quicker than buttons and menus.

On the other hand, the only interaction Vim accepts are commands and shortcuts. They are awesomely integrated within the editor, so much so that the developers know that you want to change them.

This doesn't mean that you cannot change shortcuts using alternatives, this means that the whole interaction paradigm of Vim is built around the idea of having shortcuts your own way and enhancing the experience on top on that with tools like vimscript and plugins.

Main reason: It helps you understand the Linux/Unix philosophy

This one should be the most controversial, but after a few months of editing system files with Vim I became more confident tinkering with my system. I studied Operating Systems at the university.

You may know that on theory everything in a unix-like system is just a file descriptor, that you could read and write to, but managing those files with Vim feels… not uneasy, and, having into account you can blow up your machine with a typo, that's saying a lot.

I could write a few paragraphs about how having to trust you skills with shell in order to do the work shell should (like finding files or generating directory istructure) do is positive. Perhaps saying that the replace string syntax of vim is similar to the command sed. But the main thing is that Vim feels and is the module of the OS you should be using for this task.

Bonus: Vim-go is the best tool for Go development

Longstory short: Goland, Go plugin for VSCode, Atom, you name it, none of those are as good for Go development as Vim with vim-go. This plugin has just everything you want for Go development, no more, no less with the minimum configuration required.

" With just this two lines in you vimrc you are ready to go:
let g:go_fmt_autosave = 1
let g:go_fmt_command = “goimports”

The code will be auto-formatted and dependencies will be auto-imported after every save. Need more? Shortcuts <C-x><C-o> to suggest an auto-complete, paired with <C-n> or <C-p> for next and previous suggestions. The command :GoTestFunc will launch the test function in which the cursor is place, :GoTest will do the same for the whole file.

There's a lot more than this plugin can do for you, but this covers easily 90% of the use cases I need from an IDE with the least amount of effort.

Good luck and happy Vim!

--

--