nixos/home/tui/config/nvim/lua/plugins/treesitter.lua
Evie Litherland-Smith 621ed60516 Add alpha
Update catppuccin integrations
Fix lsp hover from noice filter
Fix broken treesitter config
2023-05-11 18:03:39 +01:00

60 lines
1.7 KiB
Lua

return {
"nvim-treesitter/nvim-treesitter",
event = { "BufReadPre", "BufNewFile" },
dependencies = { "nvim-treesitter/nvim-treesitter-refactor" },
cmd = {
"TSToggle",
"TSBufEnable",
"TSBufToggle",
"TSInstall",
"TSUpdate",
"TSEnable",
},
config = function(_, opts)
if type(opts.ensure_installed) == "table" then
-- @type table<string, boolean>
local added = {}
opts.ensure_installed = vim.tbl_filter(function(lang)
if added[lang] then return false end
added[lang] = true
return true
end, opts.ensure_installed)
end
require("nvim-treesitter.configs").setup(opts)
end,
opts = {
ensure_installed = { "vim", "regex", "lua", "bash", "markdown", "markdown_inline" },
auto_install = false,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "gnr",
scope_incremental = "gnc",
node_decremental = "gnm",
},
},
indent = {
enable = true,
},
refactor = {
smart_rename = {
enable = true,
keymaps = {
smart_rename = "grr",
},
},
navigation = {
enable = true,
keymaps = {
goto_definition_lsp_fallback = "gnd",
},
},
},
},
}