Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
MIT License
Bot releases are hidden (Show)
asyncrun#get_root(0)
returns current rootPublished by skywind3000 4 months ago
asyncrun#get_root()
now accepts buffer number, if you pass an integer in the first argument, it will be interpreted as a buffer number.This will display the root of current buffer:
:echo asyncrun#get_root(bufnr('%'))
as well as:
:echo asyncrun#get_root('%')
Published by skywind3000 5 months ago
shellslash
issue in NeoVim.Published by skywind3000 5 months ago
g:asyncrun_shell
on Windows.Published by skywind3000 5 months ago
Published by skywind3000 7 months ago
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.Published by skywind3000 8 months ago
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
Published by skywind3000 8 months ago
asyncrun#fullname()
functionPublished by skywind3000 about 1 year ago
AsyncRun :!!command
to start gui programs.Published by skywind3000 about 1 year ago
:AsyncRun :echo 123
and display exception if failed.Published by skywind3000 about 1 year ago
g:asyncrun#current_root()
can return current root directory.Published by skywind3000 about 1 year ago
-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
Published by skywind3000 over 1 year ago
Published by skywind3000 almost 2 years ago
-runner=xxx
can work as an alias to -mode=term -pos=xxx
.Published by skywind3000 almost 2 years ago
-scroll=0
option to keep consistency.Published by skywind3000 almost 2 years ago
Changes:
-reuse=0
).-focus=0
).try this:
:AsyncRun -mode=term -pos=bottom -focus=0 -rows=5 ls -la /
You will see the autoscroll is enabled in the terminal window.
Published by skywind3000 almost 2 years ago
noautocmd
prefix to cd
command for temporary working directory changing.Published by skywind3000 almost 2 years ago
Published by skywind3000 almost 2 years ago
Published by skywind3000 almost 2 years ago
g:asyncrun_term_wipe
, set to non-zero to change the &bufhidden
of terminal buffer to 'wipe' when command finished.g:asyncrun_term_wipe
is 1
.