When using ag on the command line:
$> ag . --ignore="*node_modules/*/node_modules" -l --nocolor -f -U -g ""
I can avoid searching in any node_modules directories more than one level in my node services, which is the desired behavior.
However, when I use the following in my vimrc, node_modules directories of more than one depth level are not ignored:
" Use The Silver Searcher https://github.com/ggreer/the_silver_searcher if executable('ag') " Use Ag over Grep set grepprg=ag\ --nogroup\ --nocolor " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore let g:ctrlp_user_command = 'ag %s --ignore="*node_modules/*/node_modules" -l --nocolor -f -U -g ""' endif
How to configure ag and ctrlp to correctly ignore these directories? Not sure if I need to use another syntax (e.g. regex) or any other information when transplanting to vimrc.
The reason I don't put this in wildignore is because node_modules are ignored in my .gitignore, so I use the -U option to ignore any vcs files (thereby allowing ag to search for node_modules) - but this option also, seems to bypass wildignore.
source share