A Neovim plugin providing an asynchronous operation framework using native Lua coroutines for readable concurrency.
Coop.nvim is a Neovim plugin that provides an asynchronous operation framework using native Lua coroutines. It allows developers to write non-blocking code that looks synchronous, simplifying complex concurrency patterns within Neovim plugins and configurations. The plugin offers true parallelism, flexible cancellation, and built-in integrations with Neovim's APIs.
Neovim plugin developers and advanced users writing Lua scripts who need to manage asynchronous operations like file I/O, subprocesses, or LSP requests without blocking the editor's main thread.
Developers choose Coop for its principled design that stays close to Lua's coroutine idioms, its powerful cancellation mechanism allowing custom cleanup, and its comprehensive set of built-in utilities tailored for Neovim's ecosystem.
A Neovim plugin for readable concurrency with coroutines.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Builds directly on Lua's coroutines for idiomatic async code that looks synchronous, as demonstrated in examples like readFileAsync that mimic blocking operations without blocking.
Cancellation throws errors in tasks, enabling custom cleanup logic—unlike Nio which merely marks tasks dead, allowing developers to unload resources safely.
Includes pre-built task function versions for vim.ui, vim.uv, LSP requests, and vim.system, reducing boilerplate when handling common asynchronous Neovim operations.
Supports concurrent execution with control operators like gather and as_completed, enabling complex concurrency patterns, as shown in the sort_with_time example with parallel timers.
Easily converts any callback-based function into a non-blocking task function, and includes utilities like MPSC queues and subprocess management for advanced use cases.
Requires Neovim 0.10+, excluding users on older or stable releases who cannot upgrade, limiting adoption in environments with version constraints.
Assumes familiarity with Lua coroutines, and the FAQ warns against mixing coroutine and task functions, making it challenging for developers new to concurrency concepts.
The task abstraction layer over coroutines might introduce performance overhead compared to direct Libuv or callback usage, particularly for high-frequency operations.
Adopting Coop's unique task model can create lock-in, making future migration to other async libraries like Nio difficult due to differing cancellation and error handling approaches.