# HG changeset patch # User Steve Losh # Date 1289944336 18000 # Node ID 561ef889872d3b2b54bc6a9a3073abb17819ed93 # Parent 90083699bcd276a70dd32aeab6cd0f23e111a6a1 sub: vim/ack diff -r 90083699bcd2 -r 561ef889872d vim/bundle/ack/doc/ack.txt --- a/vim/bundle/ack/doc/ack.txt Mon Nov 15 17:15:57 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -*ack.txt* Plugin that integrates ack with Vim - -============================================================================== -Author: Antoine Imbert *ack-author* -License: Same terms as Vim itself (see |license|) - -============================================================================== -INTRODUCTION *ack* - -This plugin is a front for the Perl module App::Ack. Ack can be used as a -replacement for grep. This plugin will allow you to run ack from vim, and -shows the results in a split window. - -:Ack [options] {pattern} [{directory}] *:Ack* - - Search recursively in {directory} (which defaults to the current - directory) for the {pattern}. Behaves just like the |:grep| command, but - will open the |Quickfix| window for you. - -:AckAdd [options] {pattern} [{directory}] *:AckAdd* - - Just like |:Ack| + |:grepadd|. Appends the |quickfix| with the results - -:AckFromSearch [{directory}] *:AckFromSearch* - - Just like |:Ack| but the pattern is from previous search. - -:LAck [options] {pattern} [{directory}] *:LAck* - - Just like |:Ack| + |:lgrep|. Searches, but opens in |location-list| - -:LAckAdd [options] {pattern} [{directory}] *:LAckAdd* - - Just like |:Ack| + |:lgrepadd|. Searches, but appends results to - |location-list| - -Files containing the search term will be listed in the split window, along -with the line number of the occurrence, once for each occurrence. on -a line in this window will open the file, and place the cursor on the matching -line. - -See http://search.cpan.org/~petdance/ack/ack for more information. diff -r 90083699bcd2 -r 561ef889872d vim/bundle/ack/doc/tags --- a/vim/bundle/ack/doc/tags Mon Nov 15 17:15:57 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -:Ack ack.txt /*:Ack* -:AckAdd ack.txt /*:AckAdd* -:AckFromSearch ack.txt /*:AckFromSearch* -:LAck ack.txt /*:LAck* -:LAckAdd ack.txt /*:LAckAdd* -ack ack.txt /*ack* -ack-author ack.txt /*ack-author* -ack.txt ack.txt /*ack.txt* diff -r 90083699bcd2 -r 561ef889872d vim/bundle/ack/plugin/ack.vim --- a/vim/bundle/ack/plugin/ack.vim Mon Nov 15 17:15:57 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -" 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! s:Ack(cmd, args) - redraw - echo "Searching ..." - - let grepprg_bak=&grepprg - try - let &grepprg=g:ackprg - silent execute a:cmd . " " . a:args - finally - let &grepprg=grepprg_bak - endtry - - if a:cmd =~# '^l' - botright lopen - else - botright copen - endif - 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', )