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.84k stars 109 forks source link

Custom command #230

Open Integralist opened 3 years ago

Integralist commented 3 years ago

👋🏻 I was looking for a way to make running the same command quicker.

So I wanted an alias like:

:Ara <any list of commands>

e.g. translate...

:Ara sleep 10 && ls -la

into...

:AsyncRun -mode=term -pos=floaterm_reuse -position=bottomright -width=0.4 sleep 10 && ls -la

I found https://github.com/skywind3000/asyncrun.vim/wiki/Customize-Runner but it didn't seem quite right.

I tried something custom like:

fun! AsyncRunAlias(cmd)
  call asyncrun.AsyncRun(a:cmd, '-mode=term -pos=floaterm_reuse -position=bottomright -width=0.4')
endfun
command! -nargs=* Ara call AsyncRunAlias(<q-args>)

But this errors.

Any help would be greatly appreciated ❤️