Created
May 6, 2009 23:57
-
-
Save tpope/107826 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let g:ack = "ack -H" | |
function! s:ack(cmd,args) | |
let grepprg_bak = &grepprg | |
try | |
let &grepprg = g:ack | |
silent execute a:cmd . ' ' . a:args | |
finally | |
let &grepprg = grepprg_bak | |
endtry | |
"cwindow | |
endfunction | |
command! -nargs=* -bang -bar -complete=file Ack call s:ack('grep<bang>',<q-args>) | |
command! -nargs=* -bang -bar -complete=file AckAdd call s:ack('grepadd<bang>',<q-args>) | |
command! -nargs=* -bang -bar -complete=file LAck call s:ack('lgrep<bang>',<q-args>) | |
command! -nargs=* -bang -bar -complete=file LAckAdd call s:ack('lgrepadd<bang>',<q-args>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment