How to exclude file patterns in vimgrep?

前端 未结 1 1979
庸人自扰
庸人自扰 2021-02-12 02:25

In vim, I do search with vimgrep frequently. I have mapping like below:

map s :execute \"noautocmd vimgrep /\\\\<\" . expand(\"\")          


        
1条回答
  •  终归单人心
    2021-02-12 02:56

    As of Vim 7.3.570, you can use wildignore to exclude patterns with vimgrep.

    For example, to ignore the objd subfolder:

    :set wildignore+=objd/**
    

    Additional exclusions can be added by separating patterns with a comma:

    :set wildignore+=objd/**,obj/**,*.tmp,test.c
    

    See Vim's help documentation for a few more details.

    :help wildignore
    

    0 讨论(0)
提交回复
热议问题