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

How do I navigate quickfix entries, buffers, and conflicts with consistent bracket mappings?

Answer

]q

Explanation

The vim-unimpaired plugin (by Tim Pope) provides a consistent [x / ]x mnemonic for navigating any list-like structure in Vim. Once you learn the pattern, you can move through quickfix entries, buffers, location list items, argument files, and even merge conflict markers — all with the same mental model.

How it works

] moves forward (next), [ moves backward (previous). The letter chooses what to navigate:

Mapping Action
]q / [q next/prev quickfix entry (:cnext / :cprev)
]Q / [Q last/first quickfix entry
]b / [b next/prev buffer (:bnext / :bprev)
]l / [l next/prev location list entry
]a / [a next/prev :args file
]t / [t next/prev tag match
]n / [n next/prev SCM conflict marker (<<<<<<<)

The conflict marker navigation (]n / [n) is particularly useful during rebase or merge: jump directly to each conflict marker without searching.

Example

After running :make or :vimgrep, jump through results:

]q    " go to next quickfix error
[q    " go back to previous error
]Q    " jump to the last error in the list

Tips

  • Combine ]q with . for repetition: after applying a fix, press ]q. to jump to the next error and repeat the same fix.
  • For Neovim users, the same convention is built into several LSP plugins (like trouble.nvim) — learning the pattern pays dividends across the ecosystem.
  • Install with :Plug 'tpope/vim-unimpaired' or equivalent.

Next

How do I create or edit a Vim macro as a plain string without re-recording it?