Resources Helped Me To Learn Vim
Vim is a part of my daily work for a moderate amount of time so I invested enough time to learn fundamentals about it without diving and copying others people’s vim configuration and setups. There are some people take that approach but I am not comfortable doing that. This is I think the crucial part of learning vim, you do not put any customisation to your setup unless you are really sure what that configuration does and if that’s really what you need.
Let’s face it vim does not have the nicest UI between editors but it may be the best productivity tool in your programming arsenal if you invest enough time or at least stick with it.
vimtutor is the best way to get used to the idea of vim and after going through you can at least do some decent amount of work. Sure there will be productivity
hit from switching from your old editor but that is expected. My recommendation is to turn this into a routine on daily basis. AFAIK going through
vimtutor takes on
average 25-30min. not much considering the outcome. Try to do the exercises on each section and take a note of the commands that you think you will use regularly. If you
are constantly deleting something or inserting there is no point in learning ins and outs of some archaic command.
vimtutoron must Unix like system takes your to the tutor
if you are not sure how far you progressed just look at your keyboard and try to guess what that key do in vim. That is a good way to evaluate how far you progressed.
Mastering Vim by Damian Conway
This one I found by accident while browsing through O’Reilly collection and may not be free. This is a video series and it takes you to a level where you know some commands
but you are not sure about fundamentals behind them. It starts with going through the help system and how to use it and starting from there slowly progress to more detailed topics like
“how undo history work with new vim” or “autocompletion on just about anything”.
You know how ranges work with
substitution command but what others I can apply that range mentality. I think it is somewhere between 15-20 videos with varying length but after this,
you will be productive enough to do some real work. Also, the author suggests some plugins along the way which is a nice bonus.
I sometimes forgot some topic so I go and watch that video again until it sticks. You can also try the spaced repetition technique for this. Revise some topics regularly since you most probably forgot later on.
This book is something I am still going through from time to time and it is really great. After going first two you feel you know most of the commands but when you are doing practical work you kind of get to a point ‘ok what command or motion should I use for this task?’. Practical vim takes you from there and sets the mindset to what is vim way of doing this? what would be the shortest and practical command would accomplish what I am trying to do.
I just took notes which I find useful on this book and try to apply them with vimgolf mindset. Of course, you can’t stop and think for every action you made on your editor but it helps to practice that mindset, least number of keystrokes with atomic changes that are reversible easily.
[UPDATE] seems like there is a new version of this book comimg up.
Customise Your Setup
After going through all three you can start customising your setup. Let’s be honest you are not sure what you are putting on your
vimrc before going through those resources
and most of the time you won’t be using them because they are tailored for other people. Now you can look for frequent patterns on your daily usage and try to find ‘There should be a shorter way to do this?’ and search…