{"id":29638925,"url":"https://github.com/coderjoshdk/playground.nvim","last_synced_at":"2025-07-21T20:07:48.462Z","repository":{"id":221434860,"uuid":"754364784","full_name":"CoderJoshDK/playground.nvim","owner":"CoderJoshDK","description":"Create temporary playgrounds effortlessly in NeoVim","archived":false,"fork":false,"pushed_at":"2024-02-11T15:31:46.000Z","size":32,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-02-11T16:41:18.393Z","etag":null,"topics":["lua","neovim","neovim-plugin","nvim","scratch"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CoderJoshDK.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}},"created_at":"2024-02-07T22:38:01.000Z","updated_at":"2024-02-10T16:15:29.000Z","dependencies_parsed_at":"2024-02-11T16:49:57.100Z","dependency_job_id":null,"html_url":"https://github.com/CoderJoshDK/playground.nvim","commit_stats":null,"previous_names":["coderjoshdk/playground.nvim"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CoderJoshDK/playground.nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderJoshDK%2Fplayground.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderJoshDK%2Fplayground.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderJoshDK%2Fplayground.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderJoshDK%2Fplayground.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CoderJoshDK","download_url":"https://codeload.github.com/CoderJoshDK/playground.nvim/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderJoshDK%2Fplayground.nvim/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266371486,"owners_count":23918862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["lua","neovim","neovim-plugin","nvim","scratch"],"created_at":"2025-07-21T20:07:45.165Z","updated_at":"2025-07-21T20:07:48.451Z","avatar_url":"https://github.com/CoderJoshDK.png","language":"Lua","readme":"# playground.nvim\n\nCreate temporary playgrounds effortlessly.\n\n## Features\n\n* Create scratch environments, configured to your liking\n* Cleans itself up based on persistence defined by user ([configuration](#configuration) for more details)\n  * never delete\n  * delete after closing neovim\n  * delete after `x` hours\n* Optional integration with plugins:\n  * telescope\n* Run code with `michaelb/sniprun` (preferred) or `metakirby5/codi.vim`\n  * working on an internal way to define how to run the whole file, without the need of another plugin\n\n## Installation\n\nExample installation is done using [lazy.nvim](https://github.com/folke/lazy.nvim).  \nPlugin works out of the box. No configuration is required.\n\n```lua\n{  \n  'CoderJoshDK/playground.nvim',\n  cmd = {\n    \"Playground\",\n    \"PlaygroundSelect\",\n    \"PlaygroundDelete\",\n    \"PlaygroundDeleteAll\",\n  }\n}\n```\n\n## Commands\n\nIf possible, `telescope` is used, unless overridden by config. `telescope` is an optional dependency.\n\nBasic commands:\n\n| Command | Args | Description |\n| -- | -- | -- |\n| `:Playground` | `[ft]` `[name]` | Creates a new playground of file type `[ft]` with name `[name]`. If `[ft]` is not present, the command prompts you for the file extension. For example, if you wanted a python file, enter `py`. If no `[name]` is provided, the current time is used as the name. |  \n| `:PlaygroundSelect` | `nil` | Opens an existing playground. Prompts user for specific playground to open. |\n| `:PlaygroundSearch` | `nil` | Live grep search the files inside all playgrounds. (Requires telescope) |\n| `:PlaygroundDelete` | `nil` | Deletes expired playgrounds. Expiration is defined by setup configuration `{hours_to_live}`. See [configuration](#configuration). `:PlaygroundDelete` is attached, as an auto command, on `VimLeave`. |\n| `:PlaygroundDeleteSelect` | `nil` | Select a playground to delete. |\n| `:PlaygroundDeleteAll` | `nil` | Deletes all playgrounds regardless of configs or file age. |\n\n## Configuration\n\nPlayground.nvim comes with the following defaults\n\n```lua\n{  \n  -- Absolute path to where playgrounds are created and managed\n  -- The given example path is for MacOS, but the correct OS path will be used\n  -- WARNING Must be an absolute path\n  root_dir = \"/Users/\u003cuser\u003e/.cache/nvim/playground.nvim/\", \n  -- When no `ft` is given to `scratch.open_playground`, use the following default extension\n  default_ft = \"txt\",\n  -- hours_to_live can be:\n  -- * -1 : never delete files (unless `:PlaygroundDeleteAll` is ran)\n  -- * n  : delete all playgrounds on `VimLeave`, after `n` hours since playground creation\n  hours_to_live = -1,\n  -- Add any file type extension that you want custom settings for\n  ft = {\n      txt = {\n          -- lines of text to add to the top of the file\n          lines = { \"Quick Notes\", os.date(\"%Y-%m-%d-%H:%M:%S\") }\n      },\n      -- example of a python setup. But not set as a default\n      -- py = {\n      --     lines = { \"import numpy\", \"print('hi')\" }\n      -- }\n  },\n  telescope = true, -- weather or not to use telescope (if available)\n}\n```\n\n### Extra Configuration Details\n\n\u003cdetails\u003e\n  \u003csummary\u003eMore info on `hours_to_live`\u003c/summary\u003e\n\n`hours_to_live` defines the minimum amount of hours for the created playground to exist for.\nA created playground, will keep track of its creation time. When the user exits vim (`VimLeave`,) an auto command is ran.\nThe function ends up being the same as `:PlaygroundDelete`.\n  \nSome examples:\n\n* If set to `0`; the playgrounds will be deleted as soon as you leave neovim.\n* If set to `1`; if you create a playground at 12:20, and leave at 12:40, that playground will still exist.\n    If you then come back at 15:30, the playground you created will still exist. Only until you leave again, will it now be deleted.\n* If set to `-1`; your created playgrounds will not be automatically deleted.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eMore info on `root_dir`\u003c/summary\u003e\n  The root directory must be an absolute path. The folder it points to, must not contain anything besides files and folders generated by this plugin.\n  It is highly recommended that you leave this option alone.\n\u003c/details\u003e\n\n## Contributing\n\nPRs are always welcome. You are also welcome to create an issue for any features you want and your justification for it.\n\n## Inspiration\n\nOriginal inspiration comes from [LintaoAmons/scratch.nvim](https://github.com/LintaoAmons/scratch.nvim)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderjoshdk%2Fplayground.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderjoshdk%2Fplayground.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderjoshdk%2Fplayground.nvim/lists"}