Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I tried this:

:argdo /pattern

However, it just went through all the files very quickly, and did not pause at each location where the string was found. I just want to iterate over all the locations where a string is found, without replacing.

share|improve this question
Look at :h vimgrep – FDinoff Jan 10 '14 at 6:00
up vote 1 down vote accepted

Vim has a :sleep command that you could use in your command to pause for a few seconds at each match. But a better solution would probably be to use :vimgrep or even :vimgrepadd to build up a quickfix list including each file, which you can then iterate through on your own with :cnext/:cprev.

share|improve this answer

You will probably find this screencast very instructive.

A simpler (and less powerful) and relatively obscure (read :help :ilist) alternative:

:argdo ilist foo
:b <bufname>|<line number>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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