Uploaded by Hugo Vilela

The Power of Vim

advertisement
The power of Vim
There are two parts to vim, the motions and the editor. The motions are a bunch of shortcuts that
allow you to do common tasks quicker like da( (delete around parentheses), gUiW (convert all
text in a word to uppercase), dt" (delete until next quote).
The editor is a text editor that uses vim motions and is highly configurable using vimscript or lua
(for neovim).
The power of vim, in my opinion comes from the merge between these two. You have the most
powerful shortcuts with the ability to personalize it to your heart’s content.
The biproduct of using vim is that you end up creating your PDE (personal development
environment, in contrast with IDE). Your vim becomes finetuned to the way you and your mind
work and you’re able to achieve a level of symbiosis unachievable by other editors.
Correcting misconceptions
There’s no coming back from vim.
This is simply untrue, after being a vim user for 2 years, I spent 3 years
an iOS app using xCode without vim keybindings. For most of those years I w
android app in parallel using intelliJ with vim keybindings.
I was perfectly able to code without vim keybindings without stumbling.But
as fast as I was coding on intelliJ.
As a terminal based editor, vim lacks many features
of IDEs and isn’t as powerful
Vim does lack many *MANY* features built into modern IDEs. But it has a sim
Vim has plugins for most if not all features you find in modern IDEs, versi
diagnostics, file explorer, symbol hierarchy. Think of any feature you have
vim has a plugin for it.
Furthermore, some of these plugins use the *same* binaries your IDE uses. L
code completion, navigate to declaration and related features is through LS
There's a program that implements the LSP for, say, pyhton. And VSCode and
So, code completion in neovim is the same as code completion in VSCode.
As you can see, vim can have all the features your IDE has, and some of the
Not just that but neovim gives you an easy way to create plugins via lua an
I have 3 plugins written by myself on my own configuration. I haven't share
But those simple plugins would be a lot harder to develop in VSCode.
VSCode is designed to be used. Neovim is designed to be learned/configured
Vim is hard
Well, choose your hard. If you install vim on a regular IDE it's easy.
When in insert mode your IDE will behave as always, but then whenever you p
you'll have access to the power of vim. It allows you to learn vim at your
or to only use a small number of features of vim that you might like.
The people that say Vim is hard are usually the ones that tried jumping hea
If you are already productive with your IDE, don't throw it out of the wind
Do it progressively.
Vim is not hard, it's *comprehensive*, it has a *LOT* of features.
But you can choose which ones to use and learn.
5 years after learning vim I'm still learning new things. But
these are bonuses. It took me two months to learn the fundamentals of vim.
Everything past that is a bonus.
Developers that use Vim are better
No, it has nothing to do with your skills as a developer, vim is just a too
But developers that use vim are usually better at working with lower level
because they have spent more time working with the basics of linux. They ar
usually but not always more productive using their IDE than people who don'
people who use vim, usually, have spent a lot of time fine tuning their IDE
use patterns.
Why I learned vim and why I’m never gonna stop
using it.
In 2017 I was a college student going on Erasmus. When I got to the apartment that was going to
be my home for the next 6 months, I got confronted with my worst nightmare. My PC didn’t turn
on. It was broken. Classes would start in two days and I needed a machine to do all the
coursework. Unfortunately, I couldn’t afford a brand new machine and I ended up purchasing an
8 year old second hand computer.
The problems soon started, the laptop’s intel celeron didn’t have enough horse power for modern
IDE’s. IntelliJ would halt, there was a consistent delay between keystrokes and the letters
appearing on the screen and IntelliSense was mostly unusable. I had to find another solution.
So I googled and found Vim. The much dreaded program that I’d been avoiding since I started
using linux.
Thankfully coursework was easy enough that I could spare the time to learn how to use vim and
configure it. By the end of my Erasmus period I was developing faster than ever before, I had
learned to master unix, and I was completely addicted to vim motions.
One year later I was hired for my first job, the job was remote. One month in on the job and I
arranged a coworking session with one of my superiors so he could explain me the codebase in
depth.
I think he got shocked when he looked at the size of my computer and the fact that I was working
with vim, because a month after that I received a Macbook Pro.
Throughout my time in that job I had to develop applications for several platforms including iOS
and android.
The hardest part of my job to this day was having to use XCode on a daily basis for three years.
This was before XCode had plugins that allowed vim keybindings
Download