I try to search for {% amount
in all files under the current directory.
Using ag, this works fine:
ag -Q '{% amount'
(-Q
specify to not use any regex, try to match text literally)
I have this in my .vimrc
:
grepprg=ag --nogroup --nocolor --column
And when I use :grep -Q '{% amount'
I get the following error:
E499: Empty file name for '%' or '#', only works with ":p:h"
Which (in my understanding) mean that Vim try to expand %
and fail (because I've not opened any file).
My question is: How to search for a litteral %
when using external grep program?
Note: thanks to statox I know that the following works:
:vimgrep /%/ *