dev-environment-files/.config/nvim/lua/josean/plugins/nvim-treesitter.lua
2023-08-24 13:39:11 -04:00

52 lines
1.3 KiB
Lua

return {
{
"nvim-treesitter/nvim-treesitter",
event = { "BufReadPre", "BufNewFile" },
build = ":TSUpdate",
dependencies = {
"windwp/nvim-ts-autotag",
},
config = function()
-- import nvim-treesitter plugin
local treesitter = require("nvim-treesitter.configs")
-- configure treesitter
treesitter.setup({ -- enable syntax highlighting
highlight = {
enable = true,
},
-- enable indentation
indent = { enable = true },
-- enable autotagging (w/ nvim-ts-autotag plugin)
autotag = { enable = true },
-- ensure these language parsers are installed
ensure_installed = {
"json",
"javascript",
"typescript",
"tsx",
"yaml",
"html",
"css",
"prisma",
"markdown",
"markdown_inline",
"svelte",
"graphql",
"bash",
"lua",
"vim",
"dockerfile",
"gitignore",
},
-- enable nvim-ts-context-commentstring plugin for commenting tsx and jsx
context_commentstring = {
enable = true,
enable_autocmd = false,
},
-- auto install above language parsers
auto_install = true,
})
end,
},
}