Hacker News new | ask | show | jobs
by cromantic 2046 days ago
How can someone learn how to use/how to tweak Vim to its full capabilities? Coming from someone who does minimal tweaking on their environment beyond theming, I enjoy using Vim but always feel like I'm barely scratching the surface.
7 comments

Regarding usage, you should start with the built-in vimtutor tutorial (separate binary which was most likely installed alongside vim). From there, read the manual and start looking at resources like vimcasts.org, /r/vim, _Practical Vim_, etc. _Learn Vimscript The Hard Way_ is also a great resource, but heavy on Vimscript, which you may or may not need on a regular basis. I'd argue it's worth taking a crash course so that you can try to debug third-party plugins or write your own. Really, though, the best way to learn is to jump in with both feet and search for solutions when you want to do something that you don't know how to do.

As for "tweaking" Vim, I'd suggest checking out open source vimrcs, like ThoughtBot's or Steve Losh's. You should also browse vim.org/scripts and check out plugins by people like Tim Pope and Junegunn. I can't think of any at the moment, but I know I've seen analogues to ruby-toolbox.com and clojure-toolbox.com which index plugins and let you search by topics and are a little more curated and user friendly than vim.org. You may also want to consider an opinionated Vim distribution (Janus, Space Vim, etc.), which comes with non-standard .vimrc settings and plugins.

Speaking from experience, you force yourself to use it for a period of time, preferably in a time where the task load is slightly smaller than usual. After a full month and half of this, vim commands has more or less burned into my muscle memory. This did result in many useless :wqa being typed on other software but it was absolutely worth it.
The next step is to pay attention and note when you are doing something that seems to take a lot of commands or just generally be inefficient. When you notice this happening, search docs and articles to see if there is a better way to do it.

Over time, you will accrue the things you need to know to use vim effectively.

I'd start with `vimtutor` and then there are some tutorials I wrote that start from the very beginning. (I'd greatly appreciate feedback from others).

A big tip I have is watch youtube videos and search new tweaks. While learning commands add a few on a post-it note and use that for a week. After the week is over you either learned those commands or aren't using them and don't need them.

https://stevenwalton.github.io/tutorial/vim/2019/08/31/vim-b...

Run through the tutorial a couple times, so you learn the basics. Once you've internalized them, then start exploring the plugin ecosystem. A lot of people dive right in to customizing their vim, completely reinventing the wheel or copy/pasting configs without understanding what they do.

https://vimways.org/ is also a great resource. 'Death by a Thousand Files' in the 2018 edition is one of my favorite vim articles.

A simple method is to use it at it's simplest:

Open vim

Hit i

Type the things you need to type

Hit esc

:wq

Continue like this for a few days (maybe even map the arrow keys to hjkl, like a heretic), then I'm sure you'll think something along the lines of "hmm, I wonder how you do X in vim" learn that and continue along.

That's what I did all those years ago.

Same as most everything else.

`vimtutor` is the official starter guide

:help is an inbuilt manual, with a section for every topic you could think of