56 lines
1.9 KiB
Lua
56 lines
1.9 KiB
Lua
return {
|
|
{ -- Highlight, edit, and navigate code
|
|
"nvim-treesitter/nvim-treesitter",
|
|
build = ":TSUpdate",
|
|
opts = {
|
|
ensure_installed = {
|
|
"bash",
|
|
"c",
|
|
"diff",
|
|
"html",
|
|
"lua",
|
|
"luadoc",
|
|
"markdown",
|
|
"vim",
|
|
"vimdoc",
|
|
"jsdoc",
|
|
"templ",
|
|
"yaml", -- Agregado para YAML
|
|
},
|
|
-- Autoinstall languages that are not installed
|
|
auto_install = true,
|
|
highlight = {
|
|
enable = true,
|
|
use_languagetree = true,
|
|
-- Algunos lenguajes dependen del sistema de resaltado de regex de Vim (como Ruby) para reglas de indentación.
|
|
-- Si estás experimentando problemas de indentación extraños, añade el lenguaje a
|
|
-- la lista de additional_vim_regex_highlighting y deshabilita lenguajes para indent.
|
|
additional_vim_regex_highlighting = { "ruby", "markdown" },
|
|
},
|
|
indent = { enable = true, disable = { "ruby" } }, -- Asegúrate de no deshabilitar 'yaml'
|
|
autotag = {
|
|
enable = true,
|
|
enable_rename = true,
|
|
enable_close = true,
|
|
enable_close_on_slash = true,
|
|
filetypes = { "html", "xml", "templ", "tmpl" },
|
|
},
|
|
},
|
|
config = function(_, opts)
|
|
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
|
|
|
-- Preferir git en lugar de curl para mejorar la conectividad en algunos entornos
|
|
require("nvim-treesitter.install").prefer_git = true
|
|
---@diagnostic disable-next-line: missing-fields
|
|
require("nvim-treesitter.configs").setup(opts)
|
|
|
|
-- Módulos adicionales de nvim-treesitter que puedes usar para interactuar
|
|
-- con nvim-treesitter. Deberías explorar algunos y ver qué te interesa:
|
|
--
|
|
-- - Selección incremental: Incluido, ver `:help nvim-treesitter-incremental-selection-mod`
|
|
-- - Mostrar tu contexto actual: https://github.com/nvim-treesitter/nvim-treesitter-context
|
|
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
|
end,
|
|
},
|
|
}
|