Building and testing
As you work on your code, you will have to compile (in compiled languages, which does not apply to Python) it and run accompanying tests.
Vim supports populating build and test failures through quickfix and location lists, which we will cover in this section.
Quickfix list
You’ve already had a brush with a quickfix window in Chapter 2, Advanced Editing and Navigation, but let’s dig a bit deeper into it.
Vim has an additional mode that makes jumping to certain parts of files easier. Some Vim commands use it to navigate between positions in files, such as jumping to compile errors for :make
or search terms for :grep
or :vimgrep
. Plugins such as linters (syntax checking) or test runners use the quickfix list as well.
Let’s try using a quickfix list by running a :grep
command to search for the ingredient
keyword recursively (-r
) in every Python file (--include="*.py"
), starting in the current directory (.
):
:grep -r...