Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
1  
Look at :h vimgrep –  FDinoff Jan 10 at 6:00

2 Answers 2

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

 
discard

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.