diff --git a/source/_posts/vim.md b/source/_posts/vim.md index 803ffd8..f6ea679 100644 --- a/source/_posts/vim.md +++ b/source/_posts/vim.md @@ -611,6 +611,34 @@ See: [Ranges](#ranges) {.shortcuts} +## Quickfix List (Advanced) + +### Usage + +The Quickfix List is primarily used to navigate a list of errors/warnings (or file locations) generated by a compiler or linter. + +| Shortcut | Description | +| :----------- | :--------------------------------------------------------------- | +| `:copen` | Open the quickfix window | +| `:cclose` | Close the quickfix window | +| `:cnext` | Go to the **next** error/location (`:cn` also works) | +| `:cprevious` | Go to the **previous** error/location (`:cp` also works) | +| `:clist` | List all errors/locations in the list | +| `:cf [file]` | Populate the list with errors from a file (e.g., a compiler log) | + +--- + +### Quickfix Do (`:cdo` and `:cfdo`) + +The `:cdo` (quickfix do) and `:cfdo` (quickfix file do) commands execute a command in every file listed in the quickfix list. `:cdo` iterates over every _location_ in the list, while `:cfdo` iterates over every _unique file_ in the list. + +| Command | Description | +| :------------ | :-------------------------------------------------------------- | +| `:cdo [cmd]` | Execute `[cmd]` for every **location** in the quickfix list. | +| `:cfdo [cmd]` | Execute `[cmd]` for every **unique file** in the quickfix list. | + +--- + ## Miscellaneous ### Case {.row-span-2}