A lean and mean async command runner for Vim 8 and later.
Please note, that only one command can be running at any given time. This is by design.
map <C-b> :call asynctotem#run(&makeprg)<CR>
map <C-r> :call asynctotem#run(&makeprg, 'release')<CR>
map <C-r> :call asynctotem#run('random command')<CR>
map <C-r> :call asynctotem#run('random command', 'random arguments')<CR>
command! -nargs=+ -complete=shellcmd Arun call asynctotem#run(<q-args>)
command! -nargs=+ -complete=shellcmd Amake call asynctotem#run(&makeprg, <q-args>)
command! -nargs=+ -complete=shellcmd Agrep call asynctotem#run(&grepprg, <q-args>)
The asynctotem#status()
function, can be used in order to display the run status in
a configurable statusline plugin like lightline.
let g:lightline =
\ {
\ 'active': {
\ 'left': [['mode', 'paste'], ['gitbranch'], ['asynctotem', 'readonly', 'filename', 'modified']]
\ },
\ 'component_function': {
\ 'gitbranch': 'fugitive#head',
\ 'asynctotem': 'asynctotem#status'
\ }
\ }
There are a couple of global variables that can be used to alter some of the default behavior.
Set this to 0, in order to stop q
being mapped to :cclose
and ctrl+c
to the asynctotem#kill()
function in the Quickfix
window.
The default is 1.
Set this to 1, in order to close the Quickfix
window when asynctotem#kill()
is called.
The default is 0.
Set this to 1, in order to close the Quickfix
window when there are no errors.
The default is 0.
Set this to the desired amount of milliseconds after which the Quickfix
window
will be closed, when g:asynctotem_cclose_on_kill
or g:asynctotem_cclose_on_no_error
are set to 1.
The default is 1000ms (1 second).
- Fork the project.
- Make your feature addition or bug fix.
- Do not bump the version number.
- Send me a pull request. Bonus points for topic branches.
Copyright (c) Mihail Szabolcs. Distributed under the same terms as Vim itself. See :help license.