Skip to main content

Searching and Replacing in Vim

Hands-On Lab


Photo of

Training Architect





Searching for text is more efficient than scrolling and looking for a phrase or setting. Being able to find and subsequently replace an instance of a word or phrase, or many instances, is an important skill for anyone who works with large text files, be they configuration, code, or prose.

In this hands-on lab, you will practice finding the next instance of characters, a word or phrase, either forward or backward. You'll also practice searching and replacing text using various helpful options, and also how to easily and economically repeat previous actions for smoother editing.

Finally, you'll practice on a small scale the replacement of a given string in multiple files using scripting and the ex mode of Vim.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.