From c80a54e42b52ce297f0f2f71af23c562832025c7 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Fri, 24 Jan 2025 20:35:27 +0900 Subject: init --- ar/.config/LazyVim/lua/plugins/playground.lua | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 ar/.config/LazyVim/lua/plugins/playground.lua (limited to 'ar/.config/LazyVim/lua/plugins/playground.lua') diff --git a/ar/.config/LazyVim/lua/plugins/playground.lua b/ar/.config/LazyVim/lua/plugins/playground.lua new file mode 100644 index 0000000..e696828 --- /dev/null +++ b/ar/.config/LazyVim/lua/plugins/playground.lua @@ -0,0 +1,38 @@ +return { + "nvim-treesitter/playground", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + cmd = { "TSPlaygroundToggle" }, + config = function() + 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 = "?", + }, + }, + + query_linter = { + enable = true, + use_virtual_text = true, + lint_events = { "BufWrite", "CursorHold" }, + }, + }) + end, + keys = { + { mode = "n", "pg", " TSPlaygroundToggle ", desc = "Toggle Playground" }, + { mode = "n", "pc", " TSHighlightCapturesUnderCurso ", desc = "Highlight Captures" }, + { mode = "n", "pn", " TSNodeUnderCursor ", desc = "Node Under Cursor" }, + }, +} -- cgit v1.2.3