Tim
Tim

Reputation: 13048

Vim: Ack.vim and AsyncRun conflict over quickfix window

In my Vim configuration I have both Ack.vim and AsyncRun plugins. Both plugins, at least by default, output to a quickfix window. This is an issue for me because I need to have Ack.vim results open, and then execute AsyncRun commands while processing those results. But once AsyncRun is executed, it overwrites Ack.vim results with its output, so I have to re-run same :Ack search to get next search results displayed.

Example: my workflow often includes search with :Ack, after which I modify one file from the results, write the file, then modify the file from the next result, and so on. However, I also have autocmd BufWritePost configuration which runs an AsyncRun (e.g. JS prettier or Python's yapf) when a buffer is written. Thus, once I modify the first file and write the buffer, output from Ack.vim gets replaced by the output from AsyncRun.

Is there a way to either:

Upvotes: 0

Views: 266

Answers (1)

fphilipe
fphilipe

Reputation: 10056

Have a look at Ack.vim's documentation. There are a bunch of other commands, such as :LAck, which populates the location list rather than the quickfix list.

The quickfix window is global, so you can only have one at a time. But you can always navigate to the previous and next quickfix list with :cprevious and :cnext. The location-list on the other hand is per window.

I suggest to skim through the quickfix and location-list documentation with :help quickfix.

Upvotes: 2

Related Questions