Can't get ack to work in vim

266 views
Skip to first unread message

Steven K. Wong

unread,
Aug 25, 2009, 2:08:53 PM8/25/09
to ack dev/users
After setting grepprg=ack, doing :gr somestr somedir seems to hang and
does not return any result. The status shown is:

:!ack somestr somedir 2>&1| tee /var/folders/-b/-bEIUoSRFxSNbHOLxn7gVU+
++TM/-Tmp-/v146047/3294
ack: Ignoring 1 argument on the command-line while acting as a filter.

Is this because ack is trying to read from stdin? I thought ack can be
used in vim. Please help.

Environment: ack 1.88 and MacVim 7.2 on OS X.

Damian Janowski

unread,
Aug 25, 2009, 2:38:15 PM8/25/09
to ack-...@googlegroups.com
On Tue, Aug 25, 2009 at 11:08 AM, Steven K. Wong<skws...@gmail.com> wrote:
>
> After setting grepprg=ack, doing :gr somestr somedir seems to hang and
> does not return any result. The status shown is:
>
> :!ack somestr somedir 2>&1| tee /var/folders/-b/-bEIUoSRFxSNbHOLxn7gVU+
> ++TM/-Tmp-/v146047/3294
> ack: Ignoring 1 argument on the command-line while acting as a filter.
>
> Is this because ack is trying to read from stdin? I thought ack can be
> used in vim. Please help.

Maybe your default ack is doing pagination?

Anyway, try http://www.vim.org/scripts/script.php?script_id=2572

Steven K. Wong

unread,
Aug 25, 2009, 4:36:32 PM8/25/09
to ack dev/users
What do you mean by pagination? Installing ack.vim doesn't help,
as :Ack also hangs.

I also tried ack with (non-graphical) vim, and it works there. So this
problem appears to be specific to ack when running in MacVim.

It appears that, for whatever reason, ack thinks it's running as a
filter and tries to read from stdin, which doesn't have anything to be
read, and so it blocks (hangs) on the read. I have tried :gr, :!ack,
and :Ack -- they all hang in MacVim. I'm not sure whether ack or
MacVim is at fault here.

Does anyone else have the same problem running ack in MacVim?


On Aug 25, 11:38 am, Damian Janowski <damian.janow...@gmail.com>
wrote:

Damian Janowski

unread,
Aug 25, 2009, 4:53:04 PM8/25/09
to ack-...@googlegroups.com
On Tue, Aug 25, 2009 at 1:36 PM, Steven K. Wong<skws...@gmail.com> wrote:
>
> What do you mean by pagination? Installing ack.vim doesn't help,
> as :Ack also hangs.
>
> I also tried ack with (non-graphical) vim, and it works there. So this
> problem appears to be specific to ack when running in MacVim.
>
> It appears that, for whatever reason, ack thinks it's running as a
> filter and tries to read from stdin, which doesn't have anything to be
> read, and so it blocks (hangs) on the read. I have tried :gr, :!ack,
> and :Ack -- they all hang in MacVim. I'm not sure whether ack or
> MacVim is at fault here.
>
> Does anyone else have the same problem running ack in MacVim?

I just checked on MacVim and :Ack works for me. This is what I have in
my ack.vim: http://pastie.org/594620

Steven K. Wong

unread,
Aug 25, 2009, 5:22:25 PM8/25/09
to ack dev/users
What version of ack and MacVim are you on?


On Aug 25, 1:53 pm, Damian Janowski <damian.janow...@gmail.com> wrote:

Damian Janowski

unread,
Aug 25, 2009, 6:15:42 PM8/25/09
to ack-...@googlegroups.com
On Tue, Aug 25, 2009 at 2:22 PM, Steven K. Wong<skws...@gmail.com> wrote:
>
> What version of ack and MacVim are you on?

Ack 1.86, MacVim Snapshot 49.

Steven K. Wong

unread,
Aug 25, 2009, 7:19:08 PM8/25/09
to ack dev/users
Mystery solved: Not sure why my .gvimrc has noguipty set. Not setting
it lets ack work.


On Aug 25, 3:15 pm, Damian Janowski <damian.janow...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages