ack.vim
ack.vim copied to clipboard
escape special chars in `<cword>` when run `:Ack<CR>`
In javascript / php, $
is valid in a variable.
function $sayHello () {}
If we run :Ack<CR>
when cursor is under $sayHello
, nothing will be found.
So try to escape $
and wrap <cword>
in '
.
I wonder if shellescape
or fnameescape
might help?
- This commit is only fix for the word that includes
$
, is not a universal solution. - The source file has following comment. I'm not familiar with vimscript and can't find a better solution.
" NOTE: we escape special chars, but not everything using shellescape to
" allow for passing arguments etc