nixos-from-scratch/config/nvim/lua/plugins/treesitter.lua
2025-09-01 23:30:05 -07:00

58 lines
1.8 KiB
Lua

return {
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
},
config = function()
local configs = require("nvim-treesitter.configs")
---@diagnostic disable-next-line: missing-fields
configs.setup({
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
},
},
},
-- 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",
"python",
"javascript",
"query",
"typescript",
"tsx",
"php",
"yaml",
"html",
"css",
"markdown",
"markdown_inline",
"bash",
"lua",
"vim",
"vimdoc",
"c",
"dockerfile",
"gitignore",
"astro",
},
-- auto install above language parsers
auto_install = false,
})
end
}
}