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

77 lines
1.3 KiB
Lua
Raw Normal View History

2024-05-24 16:07:28 +03:00
return {
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
init = function()
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.c3 = {
install_info = {
url = "https://github.com/c3lang/tree-sitter-c3",
files = { "src/parser.c", "src/scanner.c" },
branch = "main",
},
}
end,
2024-05-24 16:07:28 +03:00
config = function()
local configs = require("nvim-treesitter.configs")
vim.filetype.add({
extension = {
fsh = "glsl",
vsh = "glsl",
hbs = "html",
c3 = "c3",
c3i = "c3",
c3t = "c3",
},
})
vim.treesitter.language.register("html", "handlebars")
vim.treesitter.language.register("glsl", { "vsh", "fsh" })
2024-05-24 16:07:28 +03:00
configs.setup({
ensure_installed = {
-- web dev
"html",
"css",
"scss",
"javascript",
"typescript",
-- config
"toml",
"yaml",
"markdown",
"dockerfile",
-- vim
"vim",
"vimdoc",
"lua",
"query",
-- the cool stuff
"elixir",
"heex",
"rust",
"python",
"zig",
2024-09-01 00:44:34 +03:00
"nim",
2024-05-24 16:07:28 +03:00
"bash",
-- the not so cool stuff
"c",
"java",
"groovy",
"glsl",
2024-05-24 16:07:28 +03:00
},
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
end,
},
}