I found a nice feature of VIM search, i.e. listing all search results and the corresponding line numbers.
For example:
:g/for.*bar/#
Question: Is there an “easy” way to pipe/put this into another window/tab/buffer?
Cheers!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t know how to pipe the output of
:g/for.*bar/#into a new buffer but I do know how to usevimgrepto get much the same result.Try:
Now you have a buffer with all the search results and you can even navigate between them with
:cnand:cp.Take a look at
:help quickfix