Skip to content
Discussion options

You must be logged in to vote

Short version: vim.fn.system() is the old Vimscript wrapper and is synchronous (blocks UI). vim.system() is the newer API and is async by default; you call :wait() if you want to block.

So for the bootstrap snippet, vim.fn.system() is simple and works everywhere (even older Neovim), but it blocks while cloning. vim.system() avoids blocking if you use the callback or check obj:wait() later, but it’s only in newer Neovim.

In practice: if you want compatibility and don’t care about a short blocking clone during first install, vim.fn.system() is fine. If you want non‑blocking setup, you can use vim.system({...}, { text = true }, function(obj) ... end) and handle errors there, or call :wait() …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dave-kennedy
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants