Simple wrapper around libuv.spawn which makes it easy to use in neovim, specially when you want sync behaviour.
spawn exposes just a simple function that get some options:
Sync mode returns the output of program splitted based on \n
char.
local spawn = require'spawn'
spawn {
command = 'find --type s,f',
sync = { timeout = 1000, interval = 100 }
}
in async mode you need to specify stdout which can be either a number or a callback, number should represent a neovim buffer and callback should get a chunk of data and handle it.
spawn {
command = 'find --type s,f',
stdout = 5, -- results are going to be written in buffer number 5
}
spawn {
command = 'find --type s,f',
stdout = function(chunk)
-- handle data
end
}
My world in code
Loki, experimental language that compiles to C.
Async webserver implemented in both Zig and Rust
Simple, Customizable start screen for Neovim
Simple statusline for neovim, all in lua, all the time :)
define same behaviour across different file types.
Fuzzy matching for Neovim
Another lisp that compiles to lua