Closed johnkchow closed 10 years ago
I see what's going on here... my vim is expanding the '#' character into the current file name. I'll continue to investigate, sorry for the trouble :( Great job with the plugin!
So if I run :!ack "\#message"
, this correctly executes ack "#message"
which returns the expected results. However, when I try to do :Ack "\#message"
, this returns no results.
Try adding #
to the escape call here:
silent execute a:cmd . " " . escape(l:grepargs, '|')
(plugin/ack.vim)
See also issue #14.
The above hint won't work.
You will need to escape "#" and "%" in the argument to the command, but then also again for the shell (or quote it there).
:Ack "\#message"
turns into ack "NAME_OF_ALTERNATE_FILEmessage"
.
I'm using HAML + JS, so I need to search for ids i.e. "#message". However, when the following search returns nothing in vim:
:Ack "#message" -Q --haml
I read all the options for the ack command so I think I'm using ack properly (I could be wrong). So is this me misunderstanding the '#' symbol in the context of vim, or is this issue from elsewhere?