skywind3000 / asyncrun.vim

:rocket: Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
https://www.vim.org/scripts/script.php?script_id=5431
MIT License
1.86k stars 111 forks source link

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

Open krishnakumarg1984 opened 4 years ago

krishnakumarg1984 commented 4 years ago

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?

comfortablynick commented 3 years ago

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.