Vim searching through all existing buffers

前端 未结 8 580
刺人心
刺人心 2021-02-01 13:23

When dealing with a single file, I\'m used to:

/blah
do some work
n
do some work
n
do some work

Suppose now I want to search for some pattern o

8条回答
  •  死守一世寂寞
    2021-02-01 14:10

    We can do this using vimgrep and searching across the argslist. But first let's populate our argslist with all our buffers:

    :bufdo :args ## %
    

    Now we can search in our argslist

    :vimgrep /blah/ ##
    

    Where % == the current filepath and ## == the arglist.

    I recommend watching these vimcasts if you want to learn more: Populate the arglist, Search multiple files with vimgrep

提交回复
热议问题