I recently started using ack inside of vim (set grepprg=ack) which is a huge improvement in functionality over the standard :grep and a huge speed boost over :vimgrep when working over a nfs mount.
However, I quickly became annoyed at the lack of column number information, which prevents vim from jumping to the actual matched text.
So, to remedy the situation, I patched Ack.pm to support a new --column option and to print the column number along with the line number like so:
$ ack -H --text --column line somefile.txt somefile.txt 1:6:some line matched 2:12:some other line matched
The change is pretty simple, but I'm new to ack and I'm not sure of the full implications of this change. Hopefully this, or a similar patch can be included to improve support for vim (and probably other text editors as well).
On Fri, Oct 24, 2008 at 3:54 AM, Eric Van Dewoestine <ervan...@gmail.com> wrote:
> I recently started using ack inside of vim (set grepprg=ack) which is > a huge improvement in functionality over the standard :grep and a huge > speed boost over :vimgrep when working over a nfs mount.
> However, I quickly became annoyed at the lack of column number > information, which prevents vim from jumping to the actual matched > text.
That sounds very useful. I've also integrated ack into vim:
On Wed, Oct 29, 2008 at 2:53 AM, Ovid <curtis....@gmail.com> wrote:
> On Fri, Oct 24, 2008 at 3:54 AM, Eric Van Dewoestine <ervan...@gmail.com> wrote: >> I recently started using ack inside of vim (set grepprg=ack) which is >> a huge improvement in functionality over the standard :grep and a huge >> speed boost over :vimgrep when working over a nfs mount.
>> However, I quickly became annoyed at the lack of column number >> information, which prevents vim from jumping to the actual matched >> text.
> That sounds very useful. I've also integrated ack into vim:
> As a quick hack, I jump to the matched text with:
> execute "/\\v" . pattern
> If you use simple Perl regular expressions, this will allow vim to > usually jump directly to the first match it finds (see "help \v" in > vim).
> Cheers, > Ovid
I took a quick look at your integration and it looks like it doesn't integrate with vim's quickfix. It seems to concentrate on finding one file at a time.
While this may satisfy your workflow quite well, my primary usage takes heavy advantage of vim's quickfix support where I want to be able to navigate around all matches. The patch I submitted makes such usage much more pleasant as it allows :cnext, :cprev, etc. to place the cursor directly on the match.
Hopefully the powers that be will consider the patch for mainline integration.
On Oct 29, 2008, at 9:39 AM, Eric Van Dewoestine wrote:
> While this may satisfy your workflow quite well, my primary usage > takes heavy advantage of vim's quickfix support where I want to be > able to navigate around all matches. The patch I submitted makes such > usage much more pleasant as it allows :cnext, :cprev, etc. to place > the cursor directly on the match.
I don't understand. Are you talking about a patch to vim, or something we should be doing in ack?
On Wed, Oct 29, 2008 at 7:41 AM, Andy Lester <a...@petdance.com> wrote:
> On Oct 29, 2008, at 9:39 AM, Eric Van Dewoestine wrote:
>> While this may satisfy your workflow quite well, my primary usage >> takes heavy advantage of vim's quickfix support where I want to be >> able to navigate around all matches. The patch I submitted makes such >> usage much more pleasant as it allows :cnext, :cprev, etc. to place >> the cursor directly on the match.
> I don't understand. Are you talking about a patch to vim, or > something we should be doing in ack?
My original mail[1] includes a patch[2] to ack to allow it to print the column number along with the line number for each match found. The main motivation being integration with vim, but I would assume that other editors could take advantage of the additional information as well.