Is there a way to list all search results of vim in a separate buffer, sort of like what Ctrl-] does when multiple matches are found? Although browsing with n and N is okay too, I believe it might be even faster that way.

3 Answers 3


:grep will use the QuickFix window, which will let you see all the matches and quickly jump between them. For example, :grep <cword> % will search for the token currently under the cursor, within the current file.


I have not tried this one, but I've had it bookmarked for a while and it may be fairly close to what you want:


Since it ties into the quickfix system, you can show the matches in the quickfix window; see ":help quickfix-window".


from tuxdiary.com

vimgrep (Error List)

:vimgrep pattern %

Use j/up and k/down keys to navigate the list, Enter to select a match.
Traverse the matches in the open file using n and N the regular way.

lvim (Location List)

:lvim pattern %

Navigation is similar to that in vimgrep.

global search


Note that grep got its name from this command sequence!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.