asyncrun.vim icon indicating copy to clipboard operation
asyncrun.vim copied to clipboard

Introduce a feature to automatically close the quickfix window after a configurable delay when there are no errors or warnings

Open krishnakumarg1984 opened this issue 5 years ago • 1 comments

For example, if I am editing a single-file project (C++ source code) and upon running Asyncrun on it, there are no errors or warnings and the build completed successfully, then after a certain user-configurable delay, I would like the quickfix window to disappear automatically.

I know I can do :ccl[ose], but it quickly becomes tedious. Instead, I just want the quickfix window to be open for just enough time to comfortably read that [finished in x seconds] and then just get out of my way.

Can asyncrun or asynctasks somehow incorporate this?

krishnakumarg1984 avatar Jul 11 '20 15:07 krishnakumarg1984

You can use g:asyncrun_exit to do something like this, I think:

let g:asyncrun_exit = 'call timer_start(500, {-> execute("cclose")})'

A full function could be used as the callback if you want more logic to decide whether to close the qf window or not. There's also the QuickFixCmdPost autocmd.

comfortablynick avatar Dec 22 '20 05:12 comfortablynick