vimtricks.wiki Concise Vim tricks, one at a time.

How do I open the quickfix list in its own window to see all matches or errors at once?

Answer

:copen

Explanation

:copen opens the quickfix window — a special read-only split that displays all entries in the quickfix list. You can visually browse :vimgrep results, compiler errors, or :grep matches, and press <CR> on any line to jump directly to that file and location.

Quickfix window commands

Command Action
:copen Open the quickfix window (or focus it if already open)
:copen {height} Open with a specific height: :copen 15
:cclose / :ccl Close the quickfix window
:cwindow / :cw Open only if there are entries; close if empty
<CR> (in qf window) Jump to the entry under cursor
o Open in a horizontal split (with some ftplugin configs)

Workflow example

Search for all TODOs in the project:

:vimgrep /TODO/ **/*.py
:copen

The quickfix window shows:

src/main.py|12| # TODO: refactor this
src/utils.py|45| # TODO: add error handling
tests/test_main.py|8| # TODO: more test cases

Press <CR> on any line to jump there. Use :cnext/:cprev to navigate without the window.

Tips

  • :lopen opens the location list window — the per-window equivalent (populated by :lvimgrep, :lgrep, etc.)
  • The quickfix window is a normal buffer — you can search it with /, yank lines, etc.
  • :colder and :cnewer navigate between previous quickfix lists (Vim keeps a stack of up to 10)
  • Many plugins (ALE, vim-dispatch, vim-test) populate the quickfix list — :copen is always how you view it
  • Add autocmd QuickFixCmdPost [^l]* cwindow to your vimrc to auto-open the quickfix window after any quickfix command

Next

How do I run a search and replace only within a visually selected region?