feat(nvim): added treesitter playground extra

This commit is contained in:
Sergio Laín 2023-12-09 21:43:02 +01:00
parent 3535d78a4e
commit bb427966cd
No known key found for this signature in database
GPG key ID: 14C9B8080681777B
2 changed files with 42 additions and 0 deletions

View file

@ -27,6 +27,7 @@ return {
ft = "Outline", ft = "Outline",
pinned = true, pinned = true,
open = "OutlineOpen", open = "OutlineOpen",
size = { width = 0.15 },
}) })
end, end,
}, },

View file

@ -0,0 +1,41 @@
if vim.fn.has("nvim-0.10") == 1 then
return {
{
"nvim-treesitter/nvim-treesitter",
dependencies = {
"nvim-treesitter/playground",
},
build = ":TSInstall query",
opts = {
playground = {
enable = true,
},
query_linter = {
enable = true,
use_virtual_text = true,
lint_events = { "BufWrite", "CursorHold" },
},
},
keys = {
{ "<leader>ciT", "<Cmd>TSHighlightCapturesUnderCursor<CR>", desc = "Treesitter Highlight Groups" },
{ "<leader>cit", "<Cmd>TSPlaygroundToggle<CR>", desc = "Treesitter Playground" },
},
},
{
"folke/edgy.nvim",
optional = true,
opts = function(_, opts)
opts.right = opts.right or {}
table.insert(opts.right, {
title = "TS Playground",
ft = "tsplayground",
pinned = true,
open = "TSPlaygroundToggle",
size = { width = 0.3 },
})
end,
},
}
else
vim.notify("Treesitter Playground only works with the nightly build")
end