mileszs / ack.vim

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

In MacVim, the recent version of Ack.vim with the ! option doesn't work at all #38

Closed bsans closed 10 years ago

bsans commented 12 years ago

I cloned the latest Ack.vim and had it installed using Pathogen (amazing plugin if you haven't tried it). When I went to use the bang option to prevent opening the first result (thanks for adding this feature, btw!), I would get:

|| /bin/bash: ack -H --nocolor --nogroup: command not found

as my error message in the quickfix window. This seemed symptomatic of the ack script not being in my $PATH or something like that, but ack worked fine from my shell prompt. As it also did with all the flags passed to it (-H --nocolor --nogroup --column) in the Ack.vim script.

Eventually after much poking, I saw the following line was in a "if !exists("g:ackprg") block in the script. Even when I added the commented out line to let g:ackprg.... to my .vimrc, the plugin still didn't work.

So finally I just removed the if !exists block and left the blow line in the script:

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

Now it works great!

So..maybe reconsider the need of that if block??

kassio commented 10 years ago

I'll close it because is too old, but if this still happening on master version feel free to reopen.