If you want the power of Perl regular expressions in with vim's:grep command, put this line into your
set grepprg=ack\ --nocolor\ --nogroup\ '$*'\ *\
Now you can use ack from within vim like this:
If you want to be able to move through the results (opening each one in the editor on the line the result occurred), add these lines to your
nmap <C-v><C-n>
imap <C-v><C-n> <Esc><C-v><C-n>
nmap <C-v><C-p>
imap <C-v><C-p> <Esc><C-v><C-p>
Now <C-v><C-n> will go to the next search result, both from command and insert mode, and <C-v><C-p> will go to the previous search result.
Using ack for vim's :grep 0 Comments More | Login | Reply /