Files
dkelly-neovim/lua/dkelly/plugins/treesitter.lua
2025-11-23 15:46:52 -06:00

90 lines
1.6 KiB
Lua

return {
"nvim-treesitter/nvim-treesitter",
event = { "BufReadPre", "BufNewFile" },
build = ":TSUpdate",
dependencies = {
"nvim-treesitter/nvim-treesitter-refactor",
"windwp/nvim-ts-autotag",
},
config = function()
local treesitter = require("nvim-treesitter.configs")
treesitter.setup({
highlight = { enable = true },
indent = { enable = true },
autotag = { enable = true },
refactor = {
highlight_definitions = {
enable = true,
clear_on_cursor_move = true, -- Optional: clearer behavior
},
navigation = {
enable = true,
keymaps = {
goto_next_usage = "]r",
goto_previous_usage = "[r",
},
},
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
ensure_installed = {
-- Main programming languages
"bash",
"c",
"cpp",
"css",
"go",
"dart",
"html",
"javascript",
"json",
"lua",
"make",
"markdown",
"markdown_inline",
"python",
"regex",
"ruby",
"rust",
"toml",
"tsx",
"typescript",
"vim",
-- Popular config and data formats
"dockerfile",
"git_config",
"gitignore",
"gitattributes",
"graphql",
"ini",
"sql",
"xml",
"csv",
"mermaid",
-- Infra/DevOps/Cloud
"terraform",
"hcl",
-- Scripting/misc
"perl",
"r",
"powershell",
"fish",
-- System
"cmake",
"nix",
-- Other Neovim-related
"vimdoc",
"yaml",
"swift",
},
})
end,
}