Text Objects and Macros in Vim

12m 5s

This lesson looks at text objects and macros in Vim, both of which are tools intended to help you edit text more quickly and efficiently. Text objects allow you to make changes to words, phrases, and sections of text based on various parameters. We then look at macros, which allow you to repeat preset series of commands in order to save time.

For both text objects and macros, we will walk you through some examples of how they are used in order to give you a practical understanding of them.

Intended Audience

This lesson is ideal for anyone who needs to edit text files in a command-line environment.


If you want to follow along with the exercises in this lesson, you should have the Vim text editor installed on your computer.


If you want to follow along with the exercise(s) in this lesson, you can find the necessary resources here.

About the Author
Jason Cannon, opens in a new tab
Founder, Linux Training Academy
Learning paths

Jason is the founder of the Linux Training Academy as well as the author of "Linux for Beginners" and "Command Line Kung Fu." He has over 20 years of professional Linux experience, having worked for industry leaders such as Hewlett-Packard, Xerox, UPS, FireEye, and Amazon.com. Nothing gives him more satisfaction than knowing he has helped thousands of IT professionals level up their careers through his many books and courses.

Covered Topics