{"id":46568973,"url":"https://github.com/prjctimg/p5.nvim","last_synced_at":"2026-04-12T10:01:39.067Z","repository":{"id":331937135,"uuid":"1129804256","full_name":"prjctimg/p5.nvim","owner":"prjctimg","description":"Better editor support for p5.js 🌸 sketchspaces in Neovim","archived":false,"fork":false,"pushed_at":"2026-04-09T04:21:16.000Z","size":4972,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-09T06:21:02.803Z","etag":null,"topics":["live-server","lua","manpages","neovim","p5-js","snippets","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prjctimg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-07T15:55:10.000Z","updated_at":"2026-04-09T04:21:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/prjctimg/p5.nvim","commit_stats":null,"previous_names":["prjctimg/p5.nvim"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/prjctimg/p5.nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prjctimg%2Fp5.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prjctimg%2Fp5.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prjctimg%2Fp5.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prjctimg%2Fp5.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prjctimg","download_url":"https://codeload.github.com/prjctimg/p5.nvim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prjctimg%2Fp5.nvim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31710792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T06:22:27.080Z","status":"ssl_error","status_checked_at":"2026-04-12T06:21:52.710Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["live-server","lua","manpages","neovim","p5-js","snippets","typescript"],"created_at":"2026-03-07T08:01:01.170Z","updated_at":"2026-04-12T10:01:39.061Z","avatar_url":"https://github.com/prjctimg.png","language":"JavaScript","readme":"\n![](./logo.png)\n\n# `p5.nvim` 🌸\n\n\u003e Better editor support for p5.js sketchspaces in Neovim.\n\n[![Release](https://img.shields.io/github/v/release/prjctimg/p5.nvim)](https://github.com/prjctimg/p5.nvim/releases/latest)\n---\n\n## On this page\n\n- [Features ✨](#features)\n- [Requirements 📋](#requirements-📋)\n- [Installation 💾](#installation-💾)\n- [What's a sketchspace ?](#whats-a-sketchspace)\n- [Quick Start 🚀](#quick-start-🚀)\n- [Commands 📖](#commands-📖)\n- [Configuration ⚡](#configuration)\n- [Auto Commands 🔌](#auto-commands-🔌)\n- [Keyboard Shortcuts ⌨️](#keyboard-shortcuts-️)\n- [Troubleshooting 🔧](#troubleshooting-🔧)\n- [License 📜](#license-📜)\n\n---\n\n## Features ✨\n\n- **Live Server** 🚀 - Auto-reload preview in browser\n- **Package Management** 📦 - Install contributor libraries\n- **Sketchspace** 📁 - Minimal project setup\n- **GitHub Gist** 🔗 - Share sketches (synced to sketchspace)\n- **Console** 📺 - View browser logs in Neovim\n- **p5.js Docs** 📖 - Built-in reference via snacks.picker\n\n---\n\n## Requirements 📋\n\n- `nvim` \u003e= 0.11.0\n- Python 3.7+ (for development server)\n- [websockets](https://pypi.org/project/websockets/) Python package (`python3-websockets` on Debian/Ubuntu, or `sudo pipx install websockets`)\n- `curl` (for console streaming)\n- `lsof` (checking ports)\n\n---\n\n## Installation 💾\n\n```lua\n-- lazy.nvim (installs latest release)\n{\n  \"prjctimg/p5.nvim\",\n  dependencies = {\n    \"nvim-lua/plenary.nvim\",\n  },\n  config = function()\n    require(\"p5\").setup({})\n  end\n}\n```\n\n---\n\n## What's a sketchspace ?\n\nA directory that has a `p5.json` file is called a `sketchspace`. The file looks like this:\n\n```json\n{\n  \"version\": \"1.9.0\",\n  \"libs\": {\n    \"ml5\": \"latest\"\n  },\n  \"includes\": [\"sketch.js\"],\n  \"gist\": \"https://gist.github.com/...\"\n}\n```\n\n- `version`: p5.js version to use\n- `libs`: Object with library names as keys and their versions as values\n- `includes`: Files to include in the Gist (default: `[\"sketch.js\"]`)\n- `gist`: URL of associated GitHub Gist (optional)\n\n\u003e [!important]\n\u003e\n\u003e This file is needed for setting up and running `sketchspaces`.\n\u003e\n\u003e It currently only works with this plugin.\n\n---\n\n## Quick Start 🚀\n\n```vim\n:P5 create my-sketch\n:P5 server\n:P5 console\n```\n\n---\n\n## Commands 📖\n\n### :P5 create [name]\n\nCreate a new sketchspace.\n\n```vim\n:P5 create my-sketch\n:P5 create\n```\n\n[![P5 create](https://asciinema.org/a/795753.svg)](https://asciinema.org/a/795753)\n\n---\n\n### :P5 setup\n\nSetup assets in current sketchspace.\n\nDownloads files from gist (if configured), creates default sketch.js if missing, copies assets, generates libs.js, and installs configured libraries.\n\n```vim\n:P5 setup\n```\n\n---\n\n### :P5 install [libs...]\n\nInstall contributor libraries. Use picker or specify directly.\n\n```vim\n:P5 install ml5\n:P5 install ml5 rita p5play\n:P5 install\n```\n\n### :P5 uninstall [libs...]\n\nRemove installed libraries.\n\n```vim\n:P5 uninstall ml5\n:P5 uninstall\n```\n\n[![asciicast](https://asciinema.org/a/795789.svg)](https://asciinema.org/a/795789)\n\n---\n\n### :P5 server [port]\n\nStart/stop the development server (toggle). Opens browser automatically and enables live reload.\n\n```vim\n:P5 server\n:P5 server 8080\n```\n\n\u003ca href=\"https://asciinema.org/a/801610\" target=\"_blank\"\u003e\u003cimg src=\"https://asciinema.org/a/801610.svg\" /\u003e\u003c/a\u003e\n\n---\n\n### :P5 console\n\nToggle browser console to view console.log, errors, and warnings in Neovim.\n\n```vim\n:P5 console\n```\n\n[![P5 console](https://asciinema.org/a/801611.svg)](https://asciinema.org/a/801611)\n\n---\n\n### :P5 sync [gist|libs]\n\nSync gist or libraries.\n\n```vim\n:P5 sync gist\n:P5 sync libs\n:P5 sync\n```\n\n[![P5 sync](https://asciinema.org/a/801610.svg)](https://asciinema.org/a/801610)\n\n---\n\n### :P5 gist [desc]\n\nCreate a GitHub Gist from your sketchspace.\n\n```vim\n:P5 gist \"My awesome sketch\"\n:P5 gist\n```\n\n[![P5 gist](https://asciinema.org/a/799472.svg)](https://asciinema.org/a/799472)\n\n---\n\n### :P5 docs\n\nOpen p5.js documentation via snacks.picker.\n\n```vim\n:P5 docs\n```\n\n\u003ca href=\"https://asciinema.org/a/799478\" target=\"_blank\"\u003e\u003cimg src=\"https://asciinema.org/a/799478.svg\" /\u003e\u003c/a\u003e\n\n---\n\n## Configuration ⚡\n\n```lua\nrequire(\"p5\").setup({\n  -- Server settings\n  server = {\n    port = 8000,                    -- Server port\n    auto_start = false,             -- Auto start server when opening sketch.js\n    auto_open_browser = true,      -- Open browser automatically\n    ready_timeout = 5000,           -- Server ready timeout (ms)\n    fallback_ports = {8001, 8002, 8003},  -- Ports to try if default is busy\n\n    -- Live reload settings\n    live_reload = {\n      enabled = true,               -- Enable live reload\n      port = 12002,                -- Live reload port\n      debounce_ms = 300,           -- Debounce delay\n      watch_extensions = {\".js\", \".css\", \".html\", \".json\"},  -- Files to watch\n      exclude_dirs = {\".git\", \"node_modules\", \"dist\", \"build\"}  -- Exclude directories\n    }\n  },\n\n  -- Console settings\n  console = {\n    position = \"below\",             -- Window position: below, above, left, right\n    height = 10,                    -- Window height (lines)\n  },\n\n  -- Library settings\n  libraries = {\n    auto_update = false            -- Auto update libraries on setup\n  }\n})\n```\n\n---\n\n## Auto Commands 🔌\n\nAuto-start server when opening a sketch.js file:\n\n```lua\n-- Auto-start server when opening sketch.js\nvim.api.nvim_create_autocmd({ \"BufEnter\" }, {\n  pattern = \"sketch.js\",\n  callback = function()\n    vim.cmd(\"P5 server\")\n  end\n})\n\n-- Auto-open console when server starts\nvim.api.nvim_create_autocmd({ \"User\", \"P5ServerStarted\" }, {\n  callback = function()\n    vim.cmd(\"P5 console\")\n  end\n})\n```\n\n---\n\n## Keyboard Shortcuts ⌨️\n\nExample keybindings using `\u003cleader\u003ep` prefix:\n\n```lua\n-- General\nvim.keymap.set(\"n\", \"\u003cleader\u003ep5\", \":P5\u003cCR\u003e\", { desc = \"Open p5.nvim picker\" })\n\n-- Project\nvim.keymap.set(\"n\", \"\u003cleader\u003epc\", \":P5 create \", { desc = \"Create project\" })\nvim.keymap.set(\"n\", \"\u003cleader\u003eps\", \":P5 setup\u003cCR\u003e\", { desc = \"Setup project\" })\n\n-- Server\nvim.keymap.set(\"n\", \"\u003cleader\u003epss\", \":P5 server\u003cCR\u003e\", { desc = \"Toggle server\" })\nvim.keymap.set(\"n\", \"\u003cleader\u003epso\", \":P5 console\u003cCR\u003e\", { desc = \"Toggle console\" })\n\n-- Libraries\nvim.keymap.set(\"n\", \"\u003cleader\u003epi\", \":P5 install \", { desc = \"Install library\" })\nvim.keymap.set(\"n\", \"\u003cleader\u003epu\", \":P5 uninstall \", { desc = \"Uninstall library\" })\nvim.keymap.set(\"n\", \"\u003cleader\u003epU\", \":P5 sync libs\u003cCR\u003e\", { desc = \"Update libraries\" })\n\n-- Gist\nvim.keymap.set(\"n\", \"\u003cleader\u003epg\", \":P5 gist \", { desc = \"Create gist\" })\nvim.keymap.set(\"n\", \"\u003cleader\u003epgg\", \":P5 sync gist\u003cCR\u003e\", { desc = \"Sync gist\" })\n\n-- Docs\nvim.keymap.set(\"n\", \"\u003cleader\u003epd\", \":P5 docs\u003cCR\u003e\", { desc = \"Open p5.js docs\" })\n```\n\n---\n\n## Troubleshooting 🔧\n\n### Server Won't Start\n\n**Symptoms:** Running `:P5 server` shows an error or nothing happens.\n\n**Solutions:**\n\n1. Ensure Python 3 is installed:\n\n   ```bash\n   python3 --version\n   ```\n\n2. Check if the port is already in use:\n\n   ```bash\n   lsof -i :8000\n   ```\n\n3. Try a different port:\n\n```vim\n   :P5 server 8080\n```\n\n1. Check Neovim notifications for specific error messages\n\n### Downloads Not Working\n\nLibrary installation fails or downloads timeout.\n\n**Solutions:**\n\n1. Ensure curl is installed:\n\n   ```bash\n   curl --version\n   ```\n\n2. Check internet connection:\n\n   ```bash\n   curl -I https://cdnjs.cloudflare.com\n   ```\n\n3. Verify firewall isn't blocking `localhost` connections\n\n4. Check that you're in a valid sketchspace (has `p5.json`)\n\n### Gist Upload/Sync Fails\n\n`:P5 gist` or `:P5 sync gist` shows an error.\n\n**Solutions:**\n\n1. Ensure GitHub CLI is installed:\n\n   ```bash\n   gh --version\n   ```\n\n2. Authenticate with GitHub:\n\n   ```bash\n   gh auth login\n   ```\n\n3. Verify gist URL in `p5.json` is valid:\n\n   ```vim\n   :edit p5.json\n   ```\n\n4. For sync failures, the gist may have been deleted - run `:P5 gist` to create a new one\n\n### Library Install/Uninstall Fails\n\n`:P5 install` or `:P5 uninstall` shows an error.\n\n**Solutions:**\n\n1. Verify you're in a sketchspace (directory with a `p5.json` file):\n\n   ```bash\n   ls p5.json\n   ```\n\n2. Check assets/libs directory is writable:\n\n   ```bash\n   ls -la assets/libs\n   ```\n\n3. Run setup first to initialize:\n\n   ```vim\n   :P5 setup\n   ```\n\n---\n\n\u003e ## License 📜\n\n\u003e (c) 2026, [Dean Tarisai](https://prjctimg.me)\n\u003e\n\u003e This is free software, released under the GPL-3.0 license.\n\n---\n---\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprjctimg%2Fp5.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprjctimg%2Fp5.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprjctimg%2Fp5.nvim/lists"}