{"id":13476395,"url":"https://github.com/nvim-treesitter/playground","last_synced_at":"2025-09-29T13:30:59.018Z","repository":{"id":37559233,"uuid":"281954100","full_name":"nvim-treesitter/playground","owner":"nvim-treesitter","description":"Treesitter playground integrated into Neovim","archived":true,"fork":false,"pushed_at":"2023-09-15T17:11:44.000Z","size":2892,"stargazers_count":897,"open_issues_count":15,"forks_count":47,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-29T17:15:49.320Z","etag":null,"topics":["hacktoberfest","neovim","nvim-treesitter","tree-sitter"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nvim-treesitter.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}},"created_at":"2020-07-23T13:07:27.000Z","updated_at":"2024-10-06T00:17:32.000Z","dependencies_parsed_at":"2023-02-18T00:45:39.737Z","dependency_job_id":"3200b855-a01e-44c3-97a5-0710a915bc21","html_url":"https://github.com/nvim-treesitter/playground","commit_stats":{"total_commits":96,"total_committers":24,"mean_commits":4.0,"dds":0.7395833333333333,"last_synced_commit":"ba48c6a62a280eefb7c85725b0915e021a1a0749"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":"nvim-treesitter/module-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-treesitter%2Fplayground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-treesitter%2Fplayground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-treesitter%2Fplayground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-treesitter%2Fplayground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nvim-treesitter","download_url":"https://codeload.github.com/nvim-treesitter/playground/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234624011,"owners_count":18862266,"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","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":["hacktoberfest","neovim","nvim-treesitter","tree-sitter"],"created_at":"2024-07-31T16:01:29.797Z","updated_at":"2025-09-29T13:30:58.700Z","avatar_url":"https://github.com/nvim-treesitter.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"# Neovim Treesitter Playground\n\nView treesitter information directly in Neovim!\n\n![demo](https://user-images.githubusercontent.com/2361214/202389106-244ac890-9442-4759-9b2c-4fe3c247dfbc.gif)\n\n## Deprecation notice\n\nThis plugin is **deprecated** since the functionality is included in Neovim: Use\n\n- `:Inspect` to show the highlight groups under the cursor\n- `:InspectTree` to show the parsed syntax tree (\"TSPlayground\")\n- `:EditQuery` to open the Live Query Editor (Nvim 0.10+)\n\n## Requirements\n  - Neovim [nightly](https://github.com/neovim/neovim#install-from-source)\n  - [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) plugin (with the `query` grammar installed)\n\n## Setup\n\nInstall the plugin (vim-plug shown):\n\n```vim\nPlug 'nvim-treesitter/nvim-treesitter'\nPlug 'nvim-treesitter/playground'\n```\n\nIt's also recommended that you install the `query` parser for query editor highlighting. Run this after installing the above plugins.\n\n```vim\n:TSInstall query\n```\n\nThe configuration is like any other nvim-treesitter module.\n\n```lua\nrequire \"nvim-treesitter.configs\".setup {\n  playground = {\n    enable = true,\n    disable = {},\n    updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code\n    persist_queries = false, -- Whether the query persists across vim sessions\n    keybindings = {\n      toggle_query_editor = 'o',\n      toggle_hl_groups = 'i',\n      toggle_injected_languages = 't',\n      toggle_anonymous_nodes = 'a',\n      toggle_language_display = 'I',\n      focus_language = 'f',\n      unfocus_language = 'F',\n      update = 'R',\n      goto_node = '\u003ccr\u003e',\n      show_help = '?',\n    },\n  }\n}\n```\n\n## Usage\n\nThe tree can be toggled using the command `:TSPlaygroundToggle`.\n\n### Keybindings\n\n- `R`: Refreshes the playground view when focused or reloads the query when the query editor is focused.\n- `o`: Toggles the query editor when the playground is focused.\n- `a`: Toggles visibility of anonymous nodes.\n- `i`: Toggles visibility of highlight groups.\n- `I`: Toggles visibility of the language the node belongs to.\n- `t`: Toggles visibility of injected languages.\n- `f`: Focuses the language tree under the cursor in the playground. The query editor will now be using the focused language.\n- `F`: Unfocuses the currently focused language.\n- `\u003ccr\u003e`: Go to current node in code buffer\n\n## Query Editor\n\nPress `o` to show the query editor.\nWrite your query like `(node) @capture`,\nput the cursor under the capture to highlight the matches.\n\n## Completions\n\nWhen you are on a `query` buffer, you can get a list of suggestions with\n\u003ckbd\u003eCtrl-X Ctrl-O\u003c/kbd\u003e. See `:h 'omnifunc'`.\n\n## Query Linter\n\nThe playground can lint query files for you. For that, you need to activate the `query_linter` module:\n\n```lua\nrequire \"nvim-treesitter.configs\".setup {\n  query_linter = {\n    enable = true,\n    use_virtual_text = true,\n    lint_events = {\"BufWrite\", \"CursorHold\"},\n  },\n}\n```\n\n*Note: Query linter assumes certain directory structure to identify which language queries belong to. It expect query files to be under `./queries/\u003clanguage_name\u003e`*\n\n![image](https://user-images.githubusercontent.com/7189118/101246661-06089a00-3715-11eb-9c57-6d6439defbf8.png)\n\n## Show treesitter and syntax highlight groups under the cursor \n\nThe playground comes with `:TSHighlightCapturesUnderCursor` that shows any treesitter or syntax highlight groups under the cursor.\n\n\u003cimg src=\"https://user-images.githubusercontent.com/292349/119982982-6665ef00-bf74-11eb-93d5-9b214928c3a9.png\" width=\"450\"\u003e\n\n\u003cimg src=\"https://user-images.githubusercontent.com/292349/119983093-8c8b8f00-bf74-11eb-9fa2-3670a8253fbd.png\" width=\"450\"\u003e\n\n## Show treesitter node under the cursor\n\nIf you only wish to view information about the node your cursor is currently on (without having to open up the full tree), you can use `:TSNodeUnderCursor` instead.\nA floating window containing information about the parser, node name and row/col ranges will be shown.\n\n\u003cimg src=\"https://user-images.githubusercontent.com/30731072/210166267-038c529b-f265-4439-8ed8-807b745cf026.png\" width=\"450\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-treesitter%2Fplayground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvim-treesitter%2Fplayground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-treesitter%2Fplayground/lists"}