mileszs / ack.vim

Vim plugin for the Perl module / CLI script 'ack'
Other
3.08k stars 396 forks source link

How do I search with a pattern that contains a space? #221

Closed rightfold closed 6 years ago

rightfold commented 7 years ago

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 7 years ago

: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 7 years ago

-Q should have no effect, because there are no regex metachars involved.

rightfold commented 7 years ago

I found it: I have to use single quotes: :Ack 'foo bar' src

JonnyRa commented 6 years ago

maybe this documentation should move the front page?

JonnyRa commented 6 years ago

Nice one!