how to ignore a dir for vimgrep but not for cmdline completion

19 views
Skip to first unread message

Tom M

unread,
Jun 19, 2023, 5:11:29 AM6/19/23
to vim...@googlegroups.com
Hi all,

Is there a way to ignore a dir when searching with vimgrep and not ignored when doing command line autocompletion? The wildignore option makes vim ignore the dir in both cases. Thanks in advance,

Tom M

Enan Ajmain

unread,
Jun 19, 2023, 6:31:49 AM6/19/23
to Tom M, vim...@googlegroups.com
I don't know about :vimgrep, but in :grep, you can include/exclude files
or folders according to your ":h grepprg". I use "git grep" as my grep
program, so to exclude files or folders I do this.

:grep --no-index pattern -- :!folder :!file.txt

To reiterate, my 'grepprg' is set to this:
:let &gp = 'git grep --recursive-submodules -In $*'

--
Enan
Reply all
Reply to author
Forward
0 new messages