How do I use bracket mappings for paired operations?
Answer
[q, ]q, [b, ]b (vim-unimpaired)
Explanation
vim-unimpaired by Tim Pope provides consistent bracket mappings for navigating paired items like quickfix entries, buffers, and more.
How it works
]q/[q— next/prev quickfix entry (:cnext/:cprev)]b/[b— next/prev buffer (:bnext/:bprev)]l/[l— next/prev location list entry]f/[f— next/prev file in directory]<Space>/[<Space>— add blank line below/above
Example
After :vimgrep /TODO/ **/*.py, use ]q and [q to navigate through results.
Tips
- Install:
Plug 'tpope/vim-unimpaired' ]e/[eexchange (move) line down/upyostoggles spell checking,yontoggles numbers]x{motion}XML-encodes,[x{motion}XML-decodes- Consistent mnemonic:
]is forward/down,[is backward/up