November 2018
Beginner
330 pages
7h 21m
English
Vim has two commands to help you search across files, :grep and :vimgrep:
We'll focus on :vimgrep, since the grep tool is outside the scope of this book.
The syntax is as follows: :vimgrep <pattern> <path>. pattern could either be a string or a Vim-flavored regular expression. path will often be a wildcard; use ** as a path to search recursively (or **/*.py to restrict by filetype).
Let's try searching for a calc substring in our code base:
:vimgrep animal **/* .py
This will take us to the first match, displaying the number of matches ...