github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

mileszs / ack.vim

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 66
    • 4
  • Source
  • Commits
  • Network (4)
  • Issues (1)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Vim plugin for the Perl module / CLI script 'ack' — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

add new command to document. 
c9s (author)
Tue Jan 05 23:55:11 -0800 2010
commit  46f021caef310e1ffd703532291c7a9180532c8c
tree    1ed5ea5b861b664bd9b73eb74bbf04d04c90bebe
parent  fd3fb7f45055db8d6b24aae4140e05d77e5da00d
ack.vim /
name age
history
message
file README.md Thu Mar 05 13:33:36 -0800 2009 Now available at vim.org [mileszs]
file Rakefile Wed Mar 04 20:42:27 -0800 2009 Credit to technicalpickles I cleaned up whites... [mileszs]
directory doc/ Tue Jan 05 23:55:11 -0800 2010 add new command to document. [c9s]
directory plugin/ Tue Jan 05 23:53:41 -0800 2010 * translate vim regular expression \< and \> to... [c9s]
README.md

ack.vim

This plugin is a front for the Perl module App::Ack. Ack can be used as a replacement for 99% of the uses of grep. This plugin will allow you to run ack from vim, and shows the results in a split window.

The Official Version of this plugin is available at vim.org.

Installation

Ack

You have to install ack, of course.

Install on Ubuntu with:

sudo apt-get install ack-grep

Install on Gentoo with:

sudo emerge ack

Install with MacPorts:

sudo port install p5-app-ack

Install with Gentoo Prefix

emerge ack

Otherwise, you are on your own.

The Plugin

If you have Rake installed, you can just run: rake install.

Otherwise, the file ack.vim goes in ~/.vim/plugin, and the ack.txt file belongs in ~/.vim/doc. Be sure to run

:helptags ~/.vim/doc

afterwards.

Usage

:Ack [options] {pattern} [{directory}]

Search recursively in {directory} (which defaults to the current directory) for the {pattern}.

Files containing the search term will be listed in the split window, along 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.

Just like where you use :grep, :grepadd, :lgrep, and :lgrepadd, you can use :Ack, :AckAdd, :LAck, and :LAckAdd respectively.

From the ack docs (my favorite feature):

--type=TYPE, --type=noTYPE

    Specify the types of files to include or exclude from a search. TYPE is a filetype, like perl or xml. --type=perl can also be specified as --perl, and --type=noperl can be done as --noperl.

    If a file is of both type "foo" and "bar", specifying --foo and --nobar will exclude the file, because an exclusion takes precedence over an inclusion.

    Type specifications can be repeated and are ORed together.

    See ack --help=types for a list of valid types.

This Vim plugin is derived (and by derived, I mean copied, essentially) from Antoine Imbert's blog post Ack and Vim Integration (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.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server