How do I search with a pattern that contains a space?
no-longer-on-githu-b opened this issue ยท 5 comments
no-longer-on-githu-b commented
I tried several things, like :Ack foo bar src
and :Ack "foo bar" src
but they don't search for "foo bar" in src/
. I also can't find it in the documentation. How do I search with a pattern that contains whitespace?
benoittgt commented
:Ack "foo bar" src
should work. Tested only with CLI and it works. If you try with -Q
do you have the same result?
-Q, --literal Quote all metacharacters; PATTERN is literal
petdance commented
-Q
should have no effect, because there are no regex metachars involved.
rightfold commented
I found it: I have to use single quotes: :Ack 'foo bar' src
JonnyRa commented
maybe this documentation should move the front page?
JonnyRa commented
Nice one!