An Alternate Way To Run An External Async Command In Neovim
This is a draft for an alt way to run an external command. I don't use it, I use plenary. See post 2ngtllokpfsv for the way I use.
Here's an example of how to setup a Neovim plugin to make an external async call.
local async_test_function = function()
local output = ""
local cmd = {'bash', '-c', 'sleep 2; echo "PING"'}
vim.fn.jobstart(cmd, {
on_stdout = function(j, d, e)
output = output .. vim.fn.join(d)
print(output)
end
})
end
-
The
If Plenary didn't exist, this is what I'd use to run external commands asynchronously from Neovim