Vim and ack-grep: quickfix not opening files

1.5k Views Asked by At

I'm at a loss.

I'm running Debian Lenny, vim 7.3, and I've tried both ack-grep 1.80 and 1.96. I added this line to my .vimrc:

let g:ackprg="ack-grep -H --nocolor --nogroup"

[When I include --column I get an error that it is not a valid option, that's why I tried upgrading ack-grep.]

When I execute :Ack, the quickfix window shows matches in this form:

|| folder/subfolder//file.rhtml:30:def do_it

I can use the :cn, :cp, etc. methods. But I CANNOT get vim to open the files. Both return and o do nothing.

What am I missing?!

4

There are 4 best solutions below

1
On

I believe you need to escape the spaces. If you look at the g:ackprg in plugin/ack.vim, it looks like this:

let g:ackprg="ack\\ -H\\ --nocolor\\ --nogroup"

Another solution would be to symlink your ack-grep to be ack to make up for the sadness of ack getting renamed ack-grep by your distro's packager. :-(

1
On

Try emptying your Vim from everything (all plugins and settings) except for the ones necessary for ack-vim. Does that help?

0
On

I've just run into the same issue on Ubuntu. To fix it I

  • removed alias ack for ack-grep

  • added this line to .vimrc:

let g:ackprg = "ack-grep -H --nocolor --nogroup --column"

0
On

Try using the most recent version of ack.vim from github: https://github.com/mileszs/ack.vim

I was running into the same issue and this fixed it for me.

See this issue for more information: https://github.com/mileszs/ack.vim/issues/36