DEV Community

Uvindu Harshana
Uvindu Harshana

Posted on • Updated on

How to get better at vim?

I'm a newbie to programming. I like to learn vim. Is there any guide to learn from the basics to pro?

  • Thanks in advance

Edit: Found the answer I was looking for. Thanks for sharing your advices with me. Much love ♥️♥️

Top comments (24)

Collapse
 
amree profile image
Amree Zaid

Use vim as your main editor even though it's going to slow you down a lot. Learn while using it. Following tutorials is ok, but it doesn't help if you just keep on learning. You might not even need everything and it's ok to not know a lot of things.

Obvious advice: make sure to not give up. If it's too much, take a break. I stopped using vim couple of times, but in the end, I managed to use it as my main editor.

Collapse
 
gcgbarbosa profile image
George C. G. Barbosa

the best advice for sho. use it as main editor. also ignore distractions at first. it takes time to learn a few things and it is ok to ignore plugins and other things at the beginning. you are also be considerably slower for a while, but after you master it your productivity boost is going to pay off in my opinion

Collapse
 
rrdlpl profile image
R

This is in fact the best advice. I did it and after two days of work I feel pretty much confortable to keep using it.

Collapse
 
uvinduharshana profile image
Uvindu Harshana

Thanks for sharing man

Collapse
 
uvinduharshana profile image
Uvindu Harshana

Thanks a lot man for the advice. A good point "learn while using it".

Collapse
 
dglsparsons profile image
Douglas Parsons

My advice would be to not focus too much on learning everything. Focus on a simple thing, like movement (vim-adventures.com/), and navigating between insert / visual modes. Vim doesn't need to be any more daunting than this to start with.

From the super basics, you can then just ask yourself what you are doing that feels inefficient. For example, pressing j lots of times over and over to move down, or k lots of times to move up. Then look for a shorter way to do this (i.e. Ctrl + u, Ctrl + d respectively).

Keep doing this iterative improvement and before you know it you'll look like a wizard to anyone else.

Collapse
 
uvinduharshana profile image
Uvindu Harshana

Thanks man.
Sure I'll look in that.
♥️♥️

Collapse
 
wawrzyn321 profile image
Piotr Wawrzyńczyk

Speaking of games that can help you to learn vim, there's also PacVim.

Thread Thread
 
uvinduharshana profile image
Uvindu Harshana

Thank you. I'll have a look

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Most important things to force yourself to do:

  • Spend as little time as possible in insert mode. Use it literally only for inserting.
  • Use HJKL for movement.
  • Use all 3 visual modes; they all have their purpose.
  • Use the :s command and q-macros whenever possible.

Also, if you catch yourself doing something wrong, don't just think "I'll do it the vim way next time", actually undo your changes and do it right to train yourself.

Once these basics become reflexes, you'll find yourself looking for alternatives to do things faster. Starting to use w and b will be a natural step and the more :s you use the more comfortable you will be with regular expressions.

Collapse
 
reobin profile image
Robin Gagnon

Can't agree enough with the "don't aim to be the perfect vim user" point. There are many gatekeepers within the vim community, sadly.

Collapse
 
omerxx profile image
Omer Hamerman

I invite you to read a post I wrote exactly for people looking to get in!
dev.to/omerxx/vim-from-foe-to-frie...

You can added to that another post that may help you get to know commands on the keyboard: dev.to/prodopsio/vim-a-to-z-litera...

And I have some more on the topic but the first one should take you far enough :)

Collapse
 
jessekphillips profile image
Jesse Phillips

I installed the neovim Plugin to visual studio code. this is not vim. I say this mainly because the mouse selection is not the visual selection of vim. This will create some confusion on how to work in vim and since it isn't vim help will be harder to pinpoint.

Vim vets might argue not to use the mouse, or that this is ho vim would function within the terminal.

Collapse
 
adriangrigore profile image
Adrian Emil Grigore

I personally switched to github.com/martanne/vis or plain vi(1). For any scripting problems, I just use the standard tools, sed(1), awk(1), tr(1), cut(1) or write a shell script. For a few years I thought it was my fault I didnt't get vim's "advanced" features, now I think vim is leaning towards the "bloat" side. My tools are very well suited for "modern" web development. I'd recommend learning the standard UNIX tools rather than vimscript.

Collapse
 
thefern profile image
Fernando B 🚀

I would say use vim with very minimal configuration, maybe a little syntax highlight and line numbers enabled. Disable arrows so that you are not tempted to use them in normal mode. Use it and have the vim cheat sheet ready for when you need to learn a new movement. Vim tutor is a great place to start.

Here are a few tips:
dev.to/kodaman2/20-vim-shortcuts-t...

Collapse
 
jrbrtsn profile image
John Robertson

I've been using Vim for 22 years, and continue to learn new things. Whenever you think there should be a better way to do something in Vim, their probably is; check Vim tips wiki first.

Collapse
 
uvinduharshana profile image
Uvindu Harshana

Thanks man

Collapse
 
kewbish profile image
Emilie Ma

The other tips here are great - I'd like to add that you should also focus on learning mainly what you need. For example, start with the basic motion keys, and as you progress, and say, need to navigate to a matching brace, look that up. Next, if you need another movement or function, look that up as you go.

Personally, I found this helped me avoid getting overwhelmed, and it's fun to continuously learn new things.

Collapse
 
0916dhkim profile image
Danny Kim

Once you learn the basic navigation, watching other people use vim really helps a lot. When you see vim or emacs gurus working on their projects, you will see them doing all kinds of weird tricks that you would never learn if you just read the manual. After you find neat tricks to learn, you can always google for the instructions.

Collapse
 
uvinduharshana profile image
Uvindu Harshana

Roger that. Thanks 👍👍

Collapse
 
uvinduharshana profile image
Uvindu Harshana

Yeah. Thanks man for taking your time to share your advices.

Collapse
 
dephraiim profile image
Ephraim Atta-Duncan

Practice.

Collapse
 
ranjandas profile image
Ranjandas

youtube.com/playlist?list=PLm323Lc... - Check this out. The best vim playlist I have come across in Youtube.

Collapse
 
uvinduharshana profile image
Uvindu Harshana

Sure. Thanks for the reply ☺️♥️♥️