DEV Community

Uvindu Harshana
Uvindu Harshana

Posted on • Edited 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 ♥️♥️

Latest comments (24)

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
 
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
 
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
 
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
 
uvinduharshana profile image
Uvindu Harshana

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

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
 
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
 
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
 
ephraimduncan profile image
Ephraim Duncan

Practice.

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.