dotfiles/.config/nvim/lua/plugins/treesitter.lua

130 lines
2.3 KiB
Lua
Raw Normal View History

2022-12-27 18:36:38 +01:00
return {
{ "nvim-treesitter/playground", cmd = "TSPlaygroundToggle" },
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = "BufReadPost",
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
"windwp/nvim-ts-autotag",
},
config = function()
require("nvim-treesitter.configs").setup({
2022-12-28 14:36:01 +01:00
ensure_installed = {
"bash",
"c",
"cmake",
"cpp",
"css",
"diff",
2022-12-30 11:48:44 +01:00
"dockerfile",
"gdscript",
"git_rebase",
"gitcommit",
2022-12-28 14:36:01 +01:00
"gitignore",
"go",
2022-12-30 11:48:44 +01:00
"gomod",
2022-12-28 14:36:01 +01:00
"graphql",
"help",
"html",
"http",
"java",
"javascript",
"jsdoc",
"json",
"jsonc",
2022-12-30 11:48:44 +01:00
"kotlin",
2022-12-28 14:36:01 +01:00
"latex",
"lua",
2022-12-30 11:48:44 +01:00
"make",
2022-12-28 14:36:01 +01:00
"markdown",
"markdown_inline",
"meson",
"ninja",
"php",
2022-12-30 11:48:44 +01:00
"proto",
2022-12-28 14:36:01 +01:00
"python",
"query",
"regex",
2022-12-30 11:48:44 +01:00
"rego",
2022-12-28 14:36:01 +01:00
"rust",
"scss",
"sql",
"svelte",
"teal",
"toml",
"tsx",
"typescript",
"vhs",
"vim",
"vue",
"wgsl",
"yaml",
2022-12-30 11:48:44 +01:00
"zig",
2022-12-28 14:36:01 +01:00
},
2022-12-27 18:36:38 +01:00
highlight = {
enable = true,
use_languagetree = true,
},
indent = {
enable = false,
},
2022-12-28 14:36:01 +01:00
context_commentstring = { enable = true, enable_autocmd = false },
2022-12-27 18:36:38 +01:00
playground = {
enable = true,
disable = {},
updatetime = 25,
persist_queries = false,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "ss",
node_incremental = "sq",
scope_incremental = "sd",
node_decremental = "sa",
},
},
2022-12-28 14:36:01 +01:00
query_linter = {
enable = true,
use_virtual_text = true,
lint_events = { "BufWrite", "CursorHold" },
},
2022-12-27 18:36:38 +01:00
textobjects = {
move = {
enable = true,
goto_next_start = {
["]]"] = "@function.outer",
["]m"] = "@class.outer",
},
goto_next_end = {
["]["] = "@function.outer",
["]M"] = "@class.outer",
},
goto_previous_start = {
["[["] = "@function.outer",
["[m"] = "@class.outer",
},
goto_previous_end = {
["[]"] = "@function.outer",
["[M"] = "@class.outer",
},
},
},
--- nvim-ts-autotag ---
autotag = {
enable = true,
filetypes = { "html", "javascriptreact", "xml" },
},
})
end,
},
}