1
0
mirror of https://github.com/gryf/.vim.git synced 2025-12-17 11:30:29 +01:00
Files
.vim/bundle/ack/plugin/ack.vim
2012-02-13 21:19:34 +01:00

51 lines
1.3 KiB
VimL

" NOTE: You must, of course, install the ack script
" in your path.
" On Ubuntu:
" sudo apt-get install ack-grep
" ln -s /usr/bin/ack-grep /usr/bin/ack
" With MacPorts:
" sudo port install p5-app-ack
let g:ackprg="ack\\ -H\\ --nocolor\\ --nogroup"
function! Ack(args)
let grepprg_bak=&grepprg
exec "set grepprg=" . g:ackprg
execute "silent! grep " . a:args
botright copen
let &grepprg=grepprg_bak
exec "redraw!"
endfunction
function! AckAdd(args)
let grepprg_bak=&grepprg
exec "set grepprg=" . g:ackprg
execute "silent! grepadd " . a:args
botright copen
let &grepprg=grepprg_bak
exec "redraw!"
endfunction
function! LAck(args)
let grepprg_bak=&grepprg
exec "set grepprg=" . g:ackprg
execute "silent! lgrep " . a:args
botright lopen
let &grepprg=grepprg_bak
exec "redraw!"
endfunction
function! LAckAdd(args)
let grepprg_bak=&grepprg
exec "set grepprg=" . g:ackprg
execute "silent! lgrepadd " . a:args
botright lopen
let &grepprg=grepprg_bak
exec "redraw!"
endfunction
command! -nargs=* -complete=file Ack call Ack(<q-args>)
command! -nargs=* -complete=file AckAdd call AckAdd(<q-args>)
command! -nargs=* -complete=file LAck call LAck(<q-args>)
command! -nargs=* -complete=file LAckAdd call LAckAdd(<q-args>)