From e23d7a9f7363bdc69e95a1df31e093db15459fcf Mon Sep 17 00:00:00 2001 From: Ben Beltran Date: Wed, 5 Jun 2013 09:34:53 -0500 Subject: A whole bunch of new additions to the submodules --- vim/plugin/ack.vim | 79 ------------------------------------------------------ 1 file changed, 79 deletions(-) delete mode 100644 vim/plugin/ack.vim (limited to 'vim/plugin/ack.vim') diff --git a/vim/plugin/ack.vim b/vim/plugin/ack.vim deleted file mode 100644 index 8cc0d45..0000000 --- a/vim/plugin/ack.vim +++ /dev/null @@ -1,79 +0,0 @@ -" NOTE: You must, of course, install the ack script -" in your path. -" On Debian / Ubuntu: -" sudo apt-get install ack-grep -" On your vimrc: -" let g:ackprg="ack-grep -H --nocolor --nogroup --column" -" -" With MacPorts: -" sudo port install p5-app-ack - -" Location of the ack utility -if !exists("g:ackprg") - let g:ackprg="ack -H --nocolor --nogroup --column" -endif - -function! s:Ack(cmd, args) - redraw - echo "Searching ..." - - " If no pattern is provided, search for the word under the cursor - if empty(a:args) - let l:grepargs = expand("") - else - let l:grepargs = a:args - end - - " Format, used to manage column jump - if a:cmd =~# '-g$' - let g:ackformat="%f" - else - let g:ackformat="%f:%l:%c:%m" - end - - let grepprg_bak=&grepprg - let grepformat_bak=&grepformat - try - let &grepprg=g:ackprg - let &grepformat=g:ackformat - silent execute a:cmd . " " . l:grepargs - finally - let &grepprg=grepprg_bak - let &grepformat=grepformat_bak - endtry - - if a:cmd =~# '^l' - botright lopen - else - botright copen - endif - - " TODO: Document this! - exec "nnoremap q :ccl" - exec "nnoremap t T" - exec "nnoremap T TgT" - exec "nnoremap o " - exec "nnoremap go " - - " If highlighting is on, highlight the search keyword. - if exists("g:ackhighlight") - let @/=a:args - set hlsearch - end - - redraw! -endfunction - -function! s:AckFromSearch(cmd, args) - let search = getreg('/') - " translate vim regular expression to perl regular expression. - let search = substitute(search,'\(\\<\|\\>\)','\\b','g') - call s:Ack(a:cmd, '"' . search .'" '. a:args) -endfunction - -command! -bang -nargs=* -complete=file Ack call s:Ack('grep',) -command! -bang -nargs=* -complete=file AckAdd call s:Ack('grepadd', ) -command! -bang -nargs=* -complete=file AckFromSearch call s:AckFromSearch('grep', ) -command! -bang -nargs=* -complete=file LAck call s:Ack('lgrep', ) -command! -bang -nargs=* -complete=file LAckAdd call s:Ack('lgrepadd', ) -command! -bang -nargs=* -complete=file AckFile call s:Ack('grep -g', ) -- cgit