mileszs / ack.vim

Vim plugin for the Perl module / CLI script 'ack'
Other
3.08k stars 396 forks source link

Search asynchronously in the background #19

Closed blueyed closed 10 years ago

blueyed commented 13 years ago

When searching in large project trees it would be very useful to execute :Ack asynchronously in the background.

I am not sure about how to implement this and if it makes sense at all, but wanted to request it.

Here is some reference to the Vim Wiki: http://vim.wikia.com/wiki/Background\_grep\_searches

ChristianPeters commented 12 years ago

+1

polmiro commented 12 years ago

+1

mileszs commented 12 years ago

Pull requests welcome!

losingkeys commented 11 years ago

+1 and I wanted to add that it'd be cool if this was non-blocking, though in long searches it might be odd to have the buffer change while you're still typing

graywh commented 11 years ago

This sounds like a job for tpope's dispatch.vim.

svermeulen commented 11 years ago

After installing dispatch.vim these lines in ack.vim do the trick:

setlocal errorformat=%f:%l:%c:%m
let &l:makeprg=g:ackprg." ".grepargs
Make
tengomucho commented 10 years ago

@svermeulen I tried to add those lines at the end of ack.vim but I have a an error:

line  179:
E121: Undefined variable: grepargs
E15: Invalid expression: g:ackprg." ".grepargs
line  180:
E492: Not an editor command: Make

Do you know what I am doing wrong?

kassio commented 10 years ago

I don't think we can do it on vim without dispatch or something like that. If you find another way to do this without an external gem, please, open a pull request. Thank's

svermeulen commented 10 years ago

@dirac3000 Did you install vim-dispatch?

tengomucho commented 10 years ago

@svermeulen yes, I did! I realized though that the order of my bundles was wrong. Now I corrected it, but the situation is worse, i.e. When I launch gvim I see this error:

line  179:
E121: Undefined variable: grepargs
E15: Invalid expression: g:ackprg." ".grepargs
:!make  | tee /tmp/vbmtOKE/2
                            make: *** No targets specified and no makefile found.  Stop.

Vim: Error reading input, exiting...nue

Vim: Finished.

Any ideas?

Linuus commented 10 years ago

@svermeulen Can't get it to work either... Where in ack.vim should you add that?

It would be very cool if we could make ack.vim compatible with Dispatch.

EDIT: Messed around with this a bit and got something that seems to work. Will make a PR.