I couldn't really use the proposed solution because the shellescape returnshellescape
returns a string with simple quotes ''
so I couldn't use it inside the --exclude--exclude
grep opt;opt.
thisThis is what I worked:
let &grepprg="grep -n -r --exclude=\.{o,obj,~,pyc,git}\ --exclude={tags,cscope}\* $* /dev/null"
let &grepprg="grep -n -r --exclude=\\*.{o,obj,~,pyc,git}\\* --exclude={tags,cscope}\\* $* /dev/null"