Search code examples
vimgrepack

ack-grep: command not found in gvim after upgrade to Ubuntu 18.04


Running :Ack anything in gvim now gives

|| /bin/bash: ack-grep: command not found

ack-grep is already the newest version (2.22-1)

It was working fine in Ubuntu 16.04. I have the ack.vim plugin in ~/.vim/bundle/ack.vim/


Solution

  • Assuming you are using this ack.vim plugin. Then you shouldn't have to do anything.

    Ack.vim will search for executables in the following order: ack-grep, ack. You can override this with g:ackprg. If you have set g:g:ackprg then you will need to adjust g:ackprg to be set to where the ack executable path.

    let g:ackprg = '/usr/local/bin/ack'
    

    Personally, I would avoid setting the g:ackprg variable unless you really need to.

    You may also want to look into faster grep program's than ack. e.g. The Silver Searcher or ripgrep. I also haven't really found a need for a plugin like ack.vim, I just set 'grepprg' and 'grepformat' and search with :grep.