Files
dotfiles/nvim/lua/plugins/treesitter.lua
Valeriy Filippov 210e99d004 Add neovim config
2026-03-05 16:34:38 +03:00

56 lines
1.3 KiB
Lua

-- https://github.com/nvim-treesitter/nvim-treesitter
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 = {
"bash",
"dockerfile",
"gitignore",
"jinja",
"jinja_inline",
"json",
"hcl",
"helm",
"lua",
"luadoc",
"luap",
"markdown",
"markdown_inline",
"nginx",
"vim",
"vimdoc",
"yaml",
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
})
end,
}