dkprice / vim-easygrep

Fast and Easy Find and Replace Across Multiple Files
The Unlicense
325 stars 47 forks source link

Problem when setting 'ag' as grep command #63

Open hiberabyss opened 7 years ago

hiberabyss commented 7 years ago

When with following setting:

set grepprg=ag\ --nocolor\ --nogroup\ --vimgrep\ $*

Search something with \vv, following error occurs: image

The reason is that ag does not support multiple --file-search-regex, while the generated grep commands looks like this:

ag --file-search-regex="\.h"  --file-search-regex="\.cpp" 'search pattern'  to/path
ubmarco commented 4 years ago

I also use ag due to its significant search speed. The referenced commit just disables file type selection. This could however be implemented using ag --file-search-regex="(\.c|\.h)$" <regex> for several file types. It would need a refactoring of the implementation and options to support another way of passing multiple file types.