-
Notifications
You must be signed in to change notification settings - Fork 2
Home
prjctimg edited this page Aug 5, 2026
·
2 revisions
p5.nvim turns Neovim into a complete environment for p5.js sketching — project scaffolding, a built-in dev server with live reload, GitHub Gist sharing, and a Chrome DevTools Protocol (CDP) panel for debugging right from the editor.
Requires Neovim 0.11+ and Python 3. The server is a pure
asyncioHTTP server (server.py) with no third-party dependencies — the only optional binary iscurlfor CDP requests.
-- lazy.nvim
{ "prjctimg/p5.nvim", build = "python3 server.py --check-deps" }require("p5").setup({
server = { auto_start = true }, -- start dev server when entering a sketchspace
})-
:P5 create my-sketch— scaffold a sketchspace and opensketch.js -
:P5 server— start the dev server and open the sketch in your browser -
:P5 cdp— open the CDP debugging panel (Console, Network, Eval, Debugger, Performance, Info) - Edit
sketch.jsand watch the page reload automatically
| Feature | Description |
|---|---|
| Sketchspaces | Versioned p5.js projects managed by a p5.json manifest |
| Dev server | Zero-dependency asyncio server with caching and CDN fallback for p5.js |
| Live reload | WebSocket-based auto reload of the browser on file changes |
| CDP panel | Real Chrome debugging: console, network, eval, breakpoints, perf, screenshots |
| Libraries | Install contrib libraries from jsdelivr / cdnjs / unpkg, pinned per project |
| Gists | Publish, sync, and edit sketches as GitHub Gists |
| Sketchbook | Clone and browse any user's public Gists as local sketches |
| Hover docs | On-demand p5.js documentation via the LSP hover window |
| Command | Description |
|---|---|
:P5 create [name] |
Create a new sketchspace |
:P5 setup |
Install runtime assets and configured libraries |
:P5 server [start|stop|status] |
Manage the dev server |
:P5 gist [description|sync|edit] |
Publish / sync / edit a Gist |
:P5 skchbk [list|clone] |
Manage your local sketchbook |
:P5 update |
Update installed libraries |
:P5 cdp |
Open the CDP debugging panel (and subcommands, see below) |
:P5 install <lib> / :P5 uninstall <lib>
|
Manage contributor libraries |
:P5 with no arguments opens an interactive menu with the same actions.
- Architecture — modules, runtime flow, and the Neovim↔server↔Chrome split
-
Configuration — all
setup()options with defaults - Sketchspaces and Gists — project layout, lifecycle, gist workflow
- Server and API — HTTP/SSE/WebSocket endpoints and static serving
- Live Reload — how the browser stays in sync with your files
- CDP Integration — the debugging panel, tabs, and endpoints
- Testing — how the Lua and Python test suites are run safely