Hacker News new | ask | show | jobs
Ask HN: What is a good guide for learning Vim
8 points by daschaa 1495 days ago
Hey! For some time now I often have to edit files in the terminal and I would like to learn how to use VIM. What good resources are there to learn VIM? I have no experience with it and would appreciate suggestions.

I would prefer any kind of interactive learning stuff, since I'm a very lazy reader. But this is just a preference of mine - I would be willing to read stuff aswell ;-)

Thanks in advance!

10 comments

What has worked for me was to just learn a few basic functions. Save/load a file, cut-n-paste, move to line # and search. Just enough to be productive. Then I google as I needed something like search and replace, search and replace over selected line numbers, etc.

My VIM skills are still very basic and vanilla and I've used it as my main editor for a couple of years now.

My .vimrc is setup and I copy that to whatever computer I'm working on. I pretty much "stole" my setup from others.

This sounds like a good, iterative approach! Do you have your .vimrc file in a repository and download it from there when you are switching your workstation? Or how do you handle it?
I do have it in a repo and will download it from there, or if on my local network it is sometimes just as easy to scp from my desktop.
Vim ships with a tutorial, https://github.com/vim/vim/blob/master/runtime/doc/vimtutor....

‘Vimtutor’ on *nix or in windows land it should be a bat file somewhere in install directory.

I started vimtutor and I really like it!
i'm still learning it, well neovim, and have a long way to go. i was an avid blind hater for 23+ years, and pico, until nano, was he the first compile and install on each machine. i admit not learning it sooner was a huge mistake, so kudos to you for deciding to take the plunge. it's literally a game changer and personally i can't wait till i know more in depth.

anyways, my advice is to just keep using it, no matter what! funny thing, the first couple of days i could not stop typing "nano <file>" due to muscle memory so i finally aliased it to "nvim" and also created "pico" as a link to nano's binary, just in case. well, it took maybe 3 days for me to find myself in nano and trying to control it with vim commands. that was the day i removed nano from my systems and made nvim my editor of choice!

what's helped me the most on advanced features is every once in a while learn a few new key presses. i reference these [1] two [2] cheat sheets every so often and i pick 2 or 3 commands and write them on a note pad in front of me. i reference the notepad a few times until i retain the command, which is pretty hard sometimes, but so worth it.

[1]: https://devhints.io/vim

[2]: https://vim.rtorr.com/

The way I did was to install vim mode in VSCode. Because running head first in vim without any plugin would slow down any serious dev work that needs to be done. Every addon you add has it's own learning curve. So at least with vscode you're in a familiar environment and you can still get work done.
https://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressi...

This article got me from scared of of VIM to feeling crippled without it.

I have a list of Vim learning resources here, including interactive sites: https://learnbyexample.github.io/curated_resources/vim.html
Really cool, thanks!
In an interactive way, it might be installed on your system, you can try to type "vimtutor" in the command line, this is small interactive introduction.
Thanks for the hint!
How about a game? Doesn’t get more interactive than that.

https://vim-adventures.com/

Thanks, this looks promising!
Practical Vim is great.
Thanks for the hint - looks like a good book for the shelf. But is it containing good exercises where I can follow ?
shortcutfoo if you like spaced repetition