DEV Community

Cover image for Vim basics for beginners

Vim basics for beginners

Elves Sousa on October 12, 2021

In the first part of this series, I told why I've switched from VS Code to Neovim, but I didn't go deep into how differently Vim works. In this art...
Collapse
 
phantas0s profile image
Matthieu Cneude

Nice article! I would add that Vim really make sense when you have the good old habits of a typist, when your hands stay on the home row.

I've written my own guide if somebody is interested: thevaluable.dev/vim-beginner/

Collapse
 
elvessousa profile image
Elves Sousa

Hello, Matthieu! I'm glad you liked it.

What you said makes a lot of sense. I had a typewriter when I was a kid, and the home row was really a big deal. By the way, nice blog!

Collapse
 
zaeroses profile image
Zaeroses

Hi Elves, I haven't used dev.to before but I created an account to leave you a comment: I've read a couple of your vim articles now, and I wanted to say that they are very useful and such high quality! Really well written my friend, and really helpful for a beginner like me! Thanks a bunch!

Collapse
 
elvessousa profile image
Elves Sousa

Wow! Your feedback made my day!
Thanks a lot, Zaeroses!

Collapse
 
jeroen profile image
Jeroen van Meerendonk • Edited

On the same keyboard above, the Esc was in the same position as the Caps Lock key.

Maybe you mean it was in the same position as the Tab key? And the Ctrl was in the Caps Lock one.

I really want to use Vim as a daily driver, but I never start.

Collapse
 
elvessousa profile image
Elves Sousa

Well, you are right... But the change in configuration I meant is usually done to the Caps Lock key. So I included the word "almost" in that part of the text now, hahah...

About using Vim, take your time. If you devote some of your free time to it I'm sure you see the advantages. In the next article I'll show how to make it more suitable to web development, like VS Code.

Doei!

Collapse
 
foxy4096 profile image
Foxy4096

Yes, I can exit the vim now 🥲
Help Poor Children in Uganda

Collapse
 
elvessousa profile image
Elves Sousa

Yay!

Collapse
 
academicspade profile image
SpadeAcademic • Edited

I really don't get your reasons for not using VSCode. You vaguely state in your linked post that it is slow (?) without giving any details. I had a terrible experience with Vim and have gladly stopped wrestling with it in an attempt to cajole it to work fast. I have quit it because there is constant keybinding conflicts between different plugins. Many plugins do not work well with each other. Vim is terrible for C/C++ development. There is no good autocompletion (I tried Deoplete, MuComplete, YouCompleteVim, VimComplete, clang-complete and none of them are as fast as VSCode). There is no good debugging tool (I tried Vimspector, but that is not good at all). Why put yourself through so much torture? You end up wasting time polishing your .vimrc. I am now back to VSCode and Visual Studio IDE. Please don't tell me that these are GBs of harddisk space. In trying various vim plugins, my plugin folder itself was multiple GBs in size as well. In summary, do not use VIM for what it was not meant to be - a good IDE. It is not. It is a good text editor, but just leave it at that.

Collapse
 
elvessousa profile image
Elves Sousa

Well... I think that if I have options, I use the one I like most, right? I found VS Code quite slow in many occasions. For me, this is a big deal. VS Code is good enough, but I liked my experience with Vim and Neovim so far. I have both installed in my system, and don't think I have to stick with just one of them. For code completion, I use CoC (Conquer of Completion) and its plugins, which have been enough for my webdev needs. Many of them are forks of VS Code extensions.

About the "torture" you said, my Vim setup is quite minimalistic. I don't tinker with it too much. It is just one simple file with less than 130 lines. I didn't add a lot of key bindings, I just use Vim as it is. Torture for me is wasting time waiting for a bloated IDE to load and see it using a lot of my resources, with features I don't really care.

I can't argue against you about your C++ development experience in Vim, as it is not a language I worked with. You hated it, and I believe you: Vim is not for everyone. Certainly, Visual Studio does a better job with C++, and if you like it better, there is nothing wrong with that. I'm not here to call every other editor/IDE trash or to convince everyone to knee before the "almighty Vim". I'm not that kind of guy, hahah...

Collapse
 
fmgordillo profile image
Facundo Martin Gordillo

The link from

In the first part of this series

is broken 😢

Collapse
 
elvessousa profile image
Elves Sousa

Hello, Facundo. It is not broken anymore, hahah...

You can read it on my blog or on Dev.to if you prefer .