nvim/lua/plugins/treesitter.lua
2025-03-12 13:33:38 -04:00

62 lines
1.2 KiB
Lua

local config = {
ensure_installed = {
'rust',
'css',
'erlang',
'elixir',
'html',
'javascript',
'jsdoc',
'json',
'lua',
'markdown',
'markdown_inline',
'php',
'python',
'regex',
'styled',
'svelte',
'tsx',
'typescript',
'yaml',
},
highlight = {
enable = true,
use_languagetree = true,
},
indent = {
enable = true,
},
refactor = {
highlight_definitions = { enable = true },
highlight_current_scope = { enable = false },
},
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
['af'] = '@function.outer',
['if'] = '@function.inner',
},
},
},
}
return {
'nvim-treesitter/nvim-treesitter',
dependencies = {
'windwp/nvim-ts-autotag',
'JoosepAlviste/nvim-ts-context-commentstring',
'nvim-treesitter/nvim-treesitter-refactor',
'nvim-treesitter/nvim-treesitter-textobjects',
},
event = 'BufEnter',
build = ':TSUpdate',
config = function()
require('nvim-treesitter.configs').setup(config)
require('ts_context_commentstring').setup({
enable_autocmd = false,
})
end,
}