FactorPad
Build a Better Process

Master Vim - Learn How to Go from Vim Beginner to Expert Faster

Mastering Vim can take years without a plan. These Vim tips will give you a better chance at success.
  1. Set realistic expectations - Accept your starting point and identify areas of improvement.
  2. Get the basics down - Master only 75 commands and you can edit with Vim every day.
  3. Find a Cheat Sheet - Keep a list of Vim commands handy, especially one created for your skill level.
  4. Commit to using Vim - Start editing with Vim and stick with it. It will get easier.
  5. Challenge yourself - Act like an expert. Search for and try new and faster techniques.
face pic by Paul Alan Davis, CFA
Updated: February 25, 2021
That is a plan. Let's cover the details below and get you creating code faster.

Outline Back Tip Next

/ factorpad.com / tech / vim / reference / master-vim.html


An ad-free and cookie-free website.


A Plan to Master Vim

A tutorial on how to tackle the notoriously steep learning curve of Vim so you can code like the fastest developers.

Video Tutorial

Videos can be accessed from our Vim Reference Playlist on YouTube.

Master Vim - Learn how to go from Vim beginner to expert faster (11:27)

Video Script

Beginner

In the end, our goal is for the text editor to be an extension of our brain, meaning we want to get ideas out of our head and translated to code in a text file as fast as possible. So we want speed and Vim was designed for speed.

Step 1: Setting Realistic Expectations as a Beginner

It's important to understand where we each are starting from so we can set realistic expectations and develop a plan to increase our speed.

Of course if you think about it, Vim can only do part of the work here. So let's address five limitations to fast editing and what Vim can and cannot do to help.

  1. Interpreting code
  2. Typing speed
  3. Navigating files
  4. Entering commands
  5. Automating keystrokes
Interpreting code

First is how quickly you interpret code with a programming language. So for example when creating web pages in HTML, what do the tags, labels, indentation, markup, CSS and all of those reserved characters mean? And how do we create a text file to make the web page look the way we want?

A quality text editor like Vim can help with syntax highlighting and colors to identify incomplete lines or errors. In other FactorPad videos and web pages we cover how to customize Vim to help with this. But at the same time Vim cannot help with how well you know the language itself.

Typing speed

Second, typing speed is a factor. The average person types around 200 characters per minute and the professional types maybe 400. But again, for the most part Vim cannot help you here. You either type fast or you don't. So that is something you can work on independently as part of your plan. An important point to keep in mind on this, keeping your hands on the home row and not looking at them will result in faster typing.

Navigating files

Third is navigation. How quickly can you move around in a text file? Here is where Vim can help. Most beginning Vim users who are comfortable in a GUI, or graphical user interface, struggle as they shift from mouse and arrow key navigation to using Vim navigation using the hjkl keys. Because the keys sit on the home row, your hands don't have to travel as far. Later I will discuss several of our resources to help you here.

Entering commands

Fourth, common tasks are communicated to Vim using keystroke commands instead of time-wasting menus and dialog boxes common in other editors. So with only 1 to 4 keystrokes you can quickly perform tasks like searching files, selecting and replacing text or even combining files together. The exploration of these commands is a big part of what FactorPad's Vim Reference is all about, and why it is delivered in both video and web page formats.

Automating keystrokes

Fifth, and beyond the scope for most beginners, is the concept of automation or macros or custom commands designed to automate commonly performed tasks. So not only is Vim fast while you are editing, it can do many things behind the scenes. We will further explore this conversation later.

Step 2: Get the Basics Down

Now that we have our expectations set and we have a feel for what we need to work on, let's talk about the basics.

To get started, we need to know enough to be dangerous, meaning, we need to understand how to do basic tasks so we can make Vim our primary editor. Tasks such as copying, pasting, navigating, searching and saving are essential. Because Vim is a modal editor it is different from what many beginners are used to. So learning the basics is often a difficult task. Difficult enough that many people try, struggle and quit.

It doesn't have to be difficult if you focus on nailing the basics first and waiting until later to add complexity. Vim has a long list of commands. If you combine the different modes and all of the possible keystroke combinations, you might easily have over 1,000 possible commands. However, all it takes is about 75 Vim commands and you will be able to do almost everything you need to get started.

The next challenge is how to learn these commands.

Step 3: Find a Cheat Sheet

Many new programmers are baffled by how experienced coders memorize so many commands and keystrokes without using menus to jog their memory.

To be honest, most programmers do not have photographic memories and instead rely on notes, books and cheat sheets. Whether created themselves, purchased or found on the Internet, the key is to find one suited for your level. Many cheat sheets, especially those in pdf format with multiple colors and depictions of a keyboard are too complicated and frankly confuse and inundate beginners with too much information they have not seen yet.

I was not happy with the alternatives I saw, and frankly found them worthless, so I created a freely accessible Vim Cheat Sheet that is boiled down to 75 essential commands to get a beginner started. I also supplemented it with commentary, because it is important to know why things work as they do, especially at the beginner level when everything is so new.

Also, a helpful cheat sheet in Vim must address navigating and understanding modes, because it is through them that all future commands become easier to learn.

So whether it is this cheat sheet, another one you find, or one you create for yourself, bookmark it and use it frequently to jog your memory. Don't beat yourself up and think of it as cheating. All programmers do it because there is just too much to memorize.

Step 4: Commit to Using Vim

Next, you need to start editing text files with Vim and commit to it. Over time your frustration level will drop and your productivity level will increase.

When I started with Vim, I forced myself to learn Vim by transitioning from a word processor to Vim. So every time I would normally reach for Microsoft Word, instead I opened Vim and created an HTML file that when viewed through a browser looked like the end product from a word processor. Of course this was not easy. I was much slower at first, but the exercise was very valuable because it forced me to both learn Vim commands and keystrokes plus reinforce HTML at the same time.

This multi-tasking resulted in a fairly vast factorpad.com website filled with free and helpful educational resources in not only Vim, but also Linux, Python and even financial modeling in Excel.

And with practice, ingraining these keystrokes into the involuntary part of your memory is what will lead to faster speed, and less frustration.

Have fun and make learning a game

With the basics covered, you will need to practice and using a game to reinforce navigation keys is a good way to keep it light and fun.

A maze game is a perfect way to do that. You don't have to use ours, but it is here if you would like a free playground to practice. It is called the Vimazing Race - hjkl Edition. Here you take 417 steps through a maze from start to finish using just h (left), j (down), k (up) and l (right) and the penalty for an error is returning to the starting line. Try that a few times, put yourself on the clock and after some time you will have mastered the hjkl keys and will be ready for more advanced Vim navigation.

_______________________________________________________________ ~~~~~ V i m a z i n g R a c e - hjkl Edition ~~~~~ ~~ https://factorpad.com/tech/games/vimazing-race-hjkl.txt ~~ ~ ~~~ Follow the path from start (1,1) to end using only ~~~~~ ~~ ~~~ the hjkl keys. If you hit the water go back to the ~~~~~ ~~ ~~ beginning using only the hjkl keys and start over. ~~~~~ ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ ~ ~~~ ~~~~~~~~~ ~~~~~~ ~~~~~~~~~~ ~~~~~~ ~~~ ~~~ ~~ ~~~ ~ ~~~~~~~ ~~~ ~~~~~ ~ ~~~~~~~~ ~ ~~ ~ ~~~ ~~~~~~~~ ~~ ~~ ~~~~~ ~~~~ ~~~~ ~~~ 100~~~ ~~~ ~~ ~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~~~~~~~~ ~~ ~~ ~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~~~~ Copyright 2017 FactorPad LLC ~~~~~~~~~~~~~ end _______________________________________________________________
Step 5: Challenge Yourself

And finally, challenge yourself to improve. Vim experts are constantly on the lookout for new ways to do things in fewer and fewer keystrokes.

To help on this front, keep your eyes on our reference for Vim. As it grows we will continue to add new tips and insights.

So now you have a plan to master Vim by setting realistic expectations, nailing the basics, finding resources, committing to it and by challenging yourself to improve.

Best of luck and welcome to faster editing with Vim.


Vim Questions and Answers

Q:  What other resources are helpful?
A:  If you are just starting out, the vimtutor program that comes with most distributions of Vim is helpful. In about 25 minutes you will get an introduction to many of the features of Vim.


Related Vim Commands and Procedures


What's Next?

Find more free resources for learning Vim at our YouTube Channel. Hop on @factorpad on Twitter and join our no-spam email list for reminders.

Outline Back Tip Next

/ factorpad.com / tech / vim / reference / master-vim.html


vim examples
master vim
learn how to code
code faster
vim expert
vim tips
get better at vim
vim commands
coding motivation
typing speed
free online coding
coding help
improve vim
vim tutorial
vim examples

A newly-updated free resource. Connect and refer a friend today.