VIM search for pattern into quickfix

前端 未结 2 1389
情书的邮戳
情书的邮戳 2021-02-04 13:51

Basically I need to create a quickfix buffer listing all lines that match a regex. What is the best way?

The global command may not be the best, but I think it should

2条回答
  •  再見小時候
    2021-02-04 14:02

    You can also not use the global command and stick with what is built-in. Use the vimgrep command as below:

    :vimgrep /pattern/ %
    

    And then :copen or :cwindow

提交回复
热议问题