10 Tips for Becoming an Efficient Vim User (2024)

At Reverb we use MacVim to standardize the developer environment, make pairing easier, and increase efficiency. When I started at Reverb, I had never used Vim before. It took a few weeks for me to start feeling comfortable, but without tips like these, it would have taken months. Here are ten tips to help make you more efficient as you learn to use Vim.

1. Navigate more quickly by increasing your key repeat rate

Go to System Preferences -> Keyboard, increase your Key Repeat, and shorten your Delay Until Repeat. This will let you navigate more quickly with hkjl (don’t use those arrow keys!)

10 Tips for Becoming an Efficient Vim User (3)

2. Navigate vertically with gg/G and ctrl-d/ctrl-u

The easiest way to navigate vertically is by jumping straight to the line number you need using :<line number>. Sometimes you don’t know that line number, so you can ‘page’ up and down quickly with ctrl-u and ctrl-d. Need to traverse the whole document? Jump quickly to the top of the document with gg or to the bottom with G.

3. Navigate horizontally with 0 and $

There are many ways to navigate horizontally, but the most helpful to me were always 0, which takes you to the beginning of the line, and $, which takes you to the end.

4. Escape quicker by re-binding to caps lock (or using ctrl-c)

If Vim is all about keeping your fingers as close to the keyboard’s “home row” as possible, why is escape mapped to such an important function? Use a key binding program (Reverb is partial to Seil) to map escape to caps lock or start using ctrl-c, the default alternative to escape.

5. Delete and switch to insert mode simultaneously with c

In the same way d is the Vim “verb” for delete, c is the verb for change. c allows you to delete and immediately enter insert mode. For instance, ‘ct ‘ deletes everything until the next space and enters insert mode. ‘c$’ does the same thing until the end of the line.

6. Search with / and navigate with n and N

The Vim equivalent of cmd-f is / followed by the term you seek. Once you’ve searched for a term, go to the next instance with n and the previous instance with N.

7. Search and replace with :%s

If you need to replace a term, you can use the somewhat more complicated :%s command which has the following structure:

:%s/<term to replace>/<replacement>/<flags>

For instance, if you’d like to find and replace ‘grey’ with ‘gray’, you’d use :%s/grey/gray. Unfortunately, however, by default this only replaces the first instance of the term in each line. Use the g flag to replace all instances of the first term, no matter how many are in each line.

You can also use the c flag to have Vim confirm each instance before replacing it. So :%s/grey/gray/gc will find each instance of ‘grey’ and ask you to confirm you’d like it replaced with ‘gray’.

8. Jump to between previously-visited locations using ctrl-o and ctrl-i

Vim keeps track of the locations you’ve been in your files, including across files. Every time you make a change to a file or open a new file, that location is stored. You can jump to previously-visited locations with ctrl-o. Similarly, you can jump forward with ctrl-i. This means that if you are working in two files in the same tab or window (without screen splitting), you can navigate easily between them by using ctrl-o and ctrl-i.

9. Go to other files with gf

When you have your cursor anywhere in the name of another file, you can press gf to jump into that file. This is especially useful due to the common practice of naming files the same as the class they define. For increased effectiveness, see the next tip.

10. Use plugins

Standard Vim is incredibly powerful, but a large part of its power lies in its customizability. File navigation plugins like NerdTree and CtrlP are probably some of the most accessible, work-flow altering plugins around, but do some research! There’s a ton out there. At Reverb, we use YADR, a dotfile repo that greatly enhances the capabilities of both MacVim and terminal (especially for Rails developers).

Hopefully you learned something new today about how to most efficiently use Vim. With Vim, the more you streamline your workflow, the more comfortable you’ll be. If you have any tips of your own, please leave us a comment!

— Joe Levering, Software Engineer, Reverb.com

10 Tips for Becoming an Efficient Vim User (2024)
Top Articles
Letter Frequency in English – WordsRated
RSI: Relative Strength Index in TTR: Technical Trading Rules
Ron Martin Realty Cam
Combat level
Danatar Gym
Midflorida Overnight Payoff Address
Ingles Weekly Ad Lilburn Ga
Craigslist Pet Phoenix
Walgreens Alma School And Dynamite
Nm Remote Access
Select The Best Reagents For The Reaction Below.
Tanger Outlets Sevierville Directory Map
Jscc Jweb
Herbalism Guide Tbc
Newgate Honda
Diablo 3 Metascore
VMware’s Partner Connect Program: an evolution of opportunities
Panorama Charter Portal
Bend Pets Craigslist
Craiglist Kpr
ARK: Survival Evolved Valguero Map Guide: Resource Locations, Bosses, & Dinos
Classic | Cyclone RakeAmerica's #1 Lawn and Leaf Vacuum
The Grand Canyon main water line has broken dozens of times. Why is it getting a major fix only now?
Craigslist Portland Oregon Motorcycles
Missed Connections Inland Empire
My Homework Lesson 11 Volume Of Composite Figures Answer Key
Selfservice Bright Lending
Craigslist Pearl Ms
Clare Briggs Guzman
Morse Road Bmv Hours
Kirsten Hatfield Crime Junkie
Hesburgh Library Catalog
208000 Yen To Usd
NV Energy issues outage watch for South Carson City, Genoa and Glenbrook
Best Town Hall 11
Mississippi Craigslist
Trust/Family Bank Contingency Plan
Datingscout Wantmatures
Ancestors The Humankind Odyssey Wikia
What Time Is First Light Tomorrow Morning
Soulstone Survivors Igg
20 Best Things to Do in Thousand Oaks, CA - Travel Lens
World Social Protection Report 2024-26: Universal social protection for climate action and a just transition
boston furniture "patio" - craigslist
Is Ameriprise A Pyramid Scheme
National Weather Service Richmond Va
Blue Beetle Showtimes Near Regal Evergreen Parkway & Rpx
412Doctors
10 Types of Funeral Services, Ceremonies, and Events » US Urns Online
The Great Brian Last
Petfinder Quiz
Nfhs Network On Direct Tv
Latest Posts
Article information

Author: Catherine Tremblay

Last Updated:

Views: 6068

Rating: 4.7 / 5 (47 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Catherine Tremblay

Birthday: 1999-09-23

Address: Suite 461 73643 Sherril Loaf, Dickinsonland, AZ 47941-2379

Phone: +2678139151039

Job: International Administration Supervisor

Hobby: Dowsing, Snowboarding, Rowing, Beekeeping, Calligraphy, Shooting, Air sports

Introduction: My name is Catherine Tremblay, I am a precious, perfect, tasty, enthusiastic, inexpensive, vast, kind person who loves writing and wants to share my knowledge and understanding with you.