Update ALL the plugins!

git-svn-id: http://photonzero.com/dotfiles/trunk@80 23f722f6-122a-0410-8cef-c75bd312dd78
This commit is contained in:
michener 2011-03-16 00:22:13 +00:00
parent 0a85941bf4
commit 0ad6077023
42 changed files with 9620 additions and 1644 deletions

View file

@ -12,7 +12,7 @@ The *Official Version* of this plugin is available at [vim.org](http://www.vim.o
### Ack
You have to install [ack](http://search.cpan.org/~petdance/ack/ack), of course.
You have to install [ack](http://betterthangrep.com/), of course.
Install on Debian / Ubuntu with:
@ -26,6 +26,9 @@ Install on Gentoo with:
sudo emerge ack
Install with Homebrew:
brew install ack
Install with MacPorts:
sudo port install p5-app-ack
@ -59,7 +62,7 @@ in this window will open the file, and place the cursor on the matching line.
Just like where you use :grep, :grepadd, :lgrep, and :lgrepadd, you can use `:Ack`, `:AckAdd`, `:LAck`, and `:LAckAdd` respectively. (See `doc/ack.txt`, or install and `:h Ack` for more information.)
**From the [ack docs](http://search.cpan.org/~petdance/ack/ack)** (my favorite feature):
**From the [ack docs](http://betterthangrep.com/)** (my favorite feature):
--type=TYPE, --type=noTYPE
@ -71,10 +74,20 @@ Just like where you use :grep, :grepadd, :lgrep, and :lgrepadd, you can use `:Ac
See ack --help=types for a list of valid types.
### Keyboard Shortcuts ###
In the quickfix window, you can use:
o to open (same as enter)
go to preview file (open but maintain focus on ack.vim results)
t to open in new tab
T to open in new tab silently
q to close the quickfix window
This Vim plugin is derived (and by derived, I mean copied, essentially) from
Antoine Imbert's blog post [Ack and Vim
Integration](http://blog.ant0ine.com/2007/03/ack_and_vim_integration.html) (in
Integration](http://blog.ant0ine.com/typepad/2007/03/ack-and-vim-integration.html) (in
particular, the function at the bottom of the post). I added a help file that
provides just enough reference to get you going. I also highly recommend you
check out the docs for the Perl script 'ack', for obvious reasons: [ack -
grep-like text finder](http://search.cpan.org/~petdance/ack/ack).
grep-like text finder](http://betterthangrep.com/).

View file

@ -11,11 +11,12 @@ 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*
: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.
will open the |Quickfix| window for you. If [!] is not given the first
error is jumped to.
:AckAdd [options] {pattern} [{directory}] *:AckAdd*
@ -47,4 +48,4 @@ with the line number of the occurrence, once for each occurrence. <Enter> 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.
See http://betterthangrep.com/ for more information.

View file

@ -17,6 +17,13 @@ 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("<cword>")
else
let l:grepargs = a:args
end
" Format, used to manage column jump
if a:cmd =~# '-g$'
let g:ackformat="%f"
@ -29,7 +36,7 @@ function! s:Ack(cmd, args)
try
let &grepprg=g:ackprg
let &grepformat=g:ackformat
silent execute a:cmd . " " . a:args
silent execute a:cmd . " " . l:grepargs
finally
let &grepprg=grepprg_bak
let &grepformat=grepformat_bak
@ -41,7 +48,18 @@ function! s:Ack(cmd, args)
botright copen
endif
exec "nnoremap <silent> <buffer> q :ccl<CR>"
" TODO: Document this!
exec "nnoremap <silent> <buffer> q :ccl<CR>"
exec "nnoremap <silent> <buffer> t <C-W><CR><C-W>T"
exec "nnoremap <silent> <buffer> T <C-W><CR><C-W>TgT<C-W><C-W>"
exec "nnoremap <silent> <buffer> o <CR>"
exec "nnoremap <silent> <buffer> go <CR><C-W><C-W>"
" If highlighting is on, highlight the search keyword.
if exists("g:ackhighlight")
let @/=a:args
set hlsearch
end
redraw!
endfunction