To open files in Grep's output to Vim's -o -mode

前端 未结 6 992
死守一世寂寞
死守一世寂寞 2021-01-31 14:19

How can you put a list of files to Vim\'s -o -mode?

I have a list of files as Grep\'s output. I run unsuccessfully

1

grep -il          


        
6条回答
  •  情话喂你
    2021-01-31 15:03

    Run:

    grep -il sid * | vim -
    

    This tell vim to read the file from stdin, so the output of grep will be in vim. Now, put cursor on file and press gF - this will open the file on the line grep indicated.

    You can also use ^WF to open file in a new split.

提交回复
热议问题