Over the last couple years, I’ve had many interactions where people have asked about what I’m using as my editor (Neovim btw 😎). The conversation always ends up discussing Vim Motions, which I believe are objectively the best way to edit text (regardless of what IDE/Text Editor you are using). This page serves as a collection of good resources for learning Vim Motions. My goal isn’t to reinvent the wheel; there are plenty of good existing resources. I simply want to fill the gaps that I’ve seen and provide a singular page of the content I found helpful.
Note: This page focuses solely on Vim Motions, not (Neo)vim. There is a lot more you can do with an environment that is built around these motions, so I’d encourage you to give it a shot.
Plugins for Existing Editors
If you’re looking to start using Vim Motions, I highly recommend adding a plugin to emulate them to whatever IDE/editor you already use. Trying to switch to using (Neo)vim and learning Vim Motions at the same time might feel a little overwhelming, and make you feel slow for long enough to quit learning Vim Motions. Thankfully, every major editor has either a plugin for it or have it builtin.
- VSCode and Cursor
- Zed
- Any JetBrains IDE (IntelliJ docs)
Emacs- And many, many more!
Vim Motions can also be found in other text editing tools. This includes Markdown editors like Obsidian, all the way to coding platforms like Leetcode, HackerRank, and CodeSignal. It really is everywhere, and thus a skill that you get to utilize often (beyond just when writing code).
Vim Motions: Where to Start
Before you can really take advantage of motions, it’s best to have basic navigation and editing done. Vim Adventures does a pretty good job of helping with that. Once navigation feels comfortable, it’s worth checking out the official Neovim documentation for Motion to give you an idea of what is available. Vim Cheat Sheet gives good examples of common “actions” and their corresponding motion.
If you’re more of a visual learner like me, I’ve not seen a better introduction than ThePrimeagen’s introduction to Vim Motions. The videos I’d watch are:
- Vim As Your Editor - Introduction
- Vim As Your Editor - Horizontal
- Vim As Your Editor - Vertical Movements
- Vim As Your Editor - Advanced Motions P1
- Vim As Your Editor - Advanced Motions P2
The Bottom Line
The best piece of advice I got about Vim Motions from a senior dev was that if it feels slow, you’re doing it wrong. Constantly be questioning about whether there is a faster way to accomplish the task you are trying to do. With the advent of LLMs, it’s not a bad idea to ask one of them about options to do whatever task you’re trying to do.
Suggestions
In no particular order, some suggestions:
- Make extensive use of marks. Remember, you can have global and per file marks.
- For large jumps, it may be faster to just search (using
/
) for the place you are trying to jump to instead of usinghjkl
or some other distance based navigation.