https://github.com/nvim-treesitter/playground Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Project management - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] [search-key] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} nvim-treesitter / playground generated from nvim-treesitter/module-template * Notifications * Star 137 * Fork 7 Treesitter playground integrated into Neovim Apache-2.0 License 137 stars 7 forks Star Notifications * Code * Issues 5 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 6 branches 0 tags Code Clone HTTPS GitHub CLI [https://github.com/n] Use Git or checkout with SVN using the web URL. [gh repo clone nvim-t] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @theHamsta @vigoux theHamsta and vigoux feat: add omnifunc for query filetype ... 79f71e2 May 7, 2021 feat: add omnifunc for query filetype 79f71e2 Git stats * 68 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time after/ftplugin feat: add omnifunc for query filetype May 7, 2021 lua feat: add omnifunc for query filetype May 7, 2021 plugin refactor(printer): integrate injected languages Jan 19, 2021 queries/query fix(linter): Add (grouping) to toplevel-queries Dec 17, 2020 syntax refactor(printer): integrate injected languages Jan 19, 2021 .editorconfig Initial commit Jul 23, 2020 LICENSE Initial commit Jul 23, 2020 README.md feat: make keybindings configurable and show help on "?" Mar 22, 2021 demo.gif add cleanup logic and update readme Jul 24, 2020 View code Neovim Treesitter Playground Requirements Setup Usage Keybindings Query Linter README.md Neovim Treesitter Playground View treesitter information directly in Neovim! nvim-treesitter-playground Requirements * Neovim nightly * nvim-treesitter plugin Setup Install the plugin (vim-plug shown): Plug 'nvim-treesitter/nvim-treesitter' Plug 'nvim-treesitter/playground' It's also recommended that you install the query parser for query editor highlighting. Run this after installing the above plugins. :TSInstall query The configuration is like any other nvim-treesitter module. require "nvim-treesitter.configs".setup { playground = { enable = true, disable = {}, updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code persist_queries = false, -- Whether the query persists across vim sessions keybindings = { toggle_query_editor = 'o', toggle_hl_groups = 'i', toggle_injected_languages = 't', toggle_anonymous_nodes = 'a', toggle_language_display = 'I', focus_language = 'f', unfocus_language = 'F', update = 'R', goto_node = '', show_help = '?', }, } } Usage The tree can be toggled using the command :TSPlaygroundToggle. Keybindings * R: Refreshes the playground view when focused or reloads the query when the query editor is focused. * o: Toggles the query editor when the playground is focused. * a: Toggles visibility of anonymous nodes. * i: Toggles visibility of highlight groups. * I: Toggles visibility of the language the node belongs to. * t: Toggles visibility of injected languages. * f: Focuses the language tree under the cursor in the playground. The query editor will now be using the focused language. * F: Unfocuses the currently focused language. * : Go to current node in code buffer Query Linter The playground can lint query files for you. For that, you need to activate the query_linter module: require "nvim-treesitter.configs".setup { query_linter = { enable = true, use_virtual_text = true, lint_events = {"BufWrite", "CursorHold"}, }, } image About Treesitter playground integrated into Neovim Topics tree-sitter neovim nvim-treesitter Resources Readme License Apache-2.0 License Releases No releases published Packages 0 No packages published Contributors 6 * @steelsojka * @theHamsta * @vigoux * @folke * @kyazdani42 * @jedrzejboczar Languages * Lua 97.4% * Vim script 1.9% * Scheme 0.7% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.