:rocket: Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
g:asyncrun_mode
to 1 during creating a terminal buffer and clear it to 0 after buffer has been created.#TerminalOpen
or #TermOpen
autocmd can use it to detect if this terminal buffer is created by asyncrun.new g:asyncrun_rooter
hook for root detection:
g:asyncrun_rooter
dictionary is a function pointer (or name).let g:asyncrun_rooter = get(g:, 'asyncrun_rooter', {})
function! g:asyncrun_rooter.mydetect()
if unable_to_detect
return ''
endif
return '/path/to/root'
endfunc
asyncrun#fullname()
functionAsyncRun :!!command
to start gui programs.:AsyncRun :echo 123
and display exception if failed.g:asyncrun#current_root()
can return current root directory.-init=script
option to run a init script for terminal task after successfully opening the terminal window::AsyncRun -mode=term -pos=right -init=setlocal\ ft=myterminit bash
-ft=filetype
option to set filetype for a terminal buffer::AsyncRun -mode=term -pos=right -ft=myterminit bash
-runner=xxx
can work as an alias to -mode=term -pos=xxx
.-scroll=0
option to keep consistency.