From the course: Learning Vim

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Regular expressions

Regular expressions - vi Tutorial

From the course: Learning Vim

Start my 1-month free trial

Regular expressions

- [Instructor] A lot of times, you'll see where you'd like to be in the text. In other editors you'd leave the keyboard and use the mouse. In Vim you have many other ways to navigate to the text that doesn't require taking your hands off the keyboard. One that I use a lot is regular expressions. Let's open sherlock.txt, vim sherlock.txt. Say you'd like to move to the word trained, which is in line 11. If you know how many lines and words you need to move, you can use these motions. But an easier way is to search. Make sure you are in normal mode by hitting Escape, or Control + C if you don't have Escape. And then type /tra, and then Enter. And we see that we are right where we want to. You can use more than words for searching, you can use regular expressions. A regular expression is a way to match text, and it's beyond the scope of this video. There are many resources out there about regular expressions that you can read. Check out our Learning Regular Expressions course for more…

Contents