Skip to content
prjctimg edited this page Aug 5, 2026 · 2 revisions

p5.nvim

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 asyncio HTTP server (server.py) with no third-party dependencies — the only optional binary is curl for CDP requests.

Quick Start

-- 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
})
  1. :P5 create my-sketch — scaffold a sketchspace and open sketch.js
  2. :P5 server — start the dev server and open the sketch in your browser
  3. :P5 cdp — open the CDP debugging panel (Console, Network, Eval, Debugger, Performance, Info)
  4. Edit sketch.js and watch the page reload automatically

Feature Overview

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 Reference

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.

Wiki Pages

Clone this wiki locally