return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", dependencies = { 'RRethy/nvim-treesitter-endwise', "nvim-treesitter/nvim-treesitter-textobjects", 'nvim-treesitter/playground', }, event = { 'BufReadPre', 'BufNew', 'BufNewFile' }, main = "nvim-treesitter.configs", cmd = { 'TSBufDisable', 'TSBufEnable', 'TSBufToggle', 'TSConfigInfo', 'TSDisable', 'TSEditQuery', 'TSEditQueryUserAfter', 'TSEnable', 'TSInstall', 'TSInstallFromGrammar', 'TSInstallInfo', 'TSInstallSync', 'TSModuleInfo', 'TSToggle', 'TSUninstall', 'TSUpdate', 'TSUpdateSync', 'TSPlaygroundToggle', }, opts = { endwise = { enable = true }, auto_install = true, ensure_installed = { "bash", "blade", "css", "go", "gomod", "html", "javascript", "json", "lua", "luadoc", "markdown", "markdown_inline", "nix", "org", "php", "php_only", "phpdoc", "query", "rust", "sql", "svelte", "typescript", "twig", "regex", "vim", "yaml", "latex", "python", "dockerfile", "cpp", "elixir", "erlang", }, highlight = { enable = true, additional_vim_regex_highlighting = { "org" }, }, playground = { enable = true, disable = {}, updatetime = 25, -- Tiempo de actualización en milisegundos para la consulta del árbol. persist_queries = false, -- Si se debe persistir las consultas entre sesiones. }, query_linter = { enable = true, use_virtual_text = true, lint_events = {"BufWrite", "CursorHold"}, }, indent = { enable = true, }, textobjects = { select = { enable = true, lookahead = true, keymaps = { ["af"] = "@function.outer", ["if"] = "@function.inner", ["ac"] = "@conditional.outer", ["ic"] = "@conditional.inner", ["al"] = "@loop.outer", ["il"] = "@loop.inner", }, }, }, incremental_selection = { enable = true, keymaps = { init_selection = "gnn", node_incremental = "grn", scope_incremental = "grc", node_decremental = "grm", }, }, }, config = function(plug, config) local parser_config = require "nvim-treesitter.parsers".get_parser_configs() parser_config.blade = { install_info = { url = "https://github.com/EmranMR/tree-sitter-blade", files = {"src/parser.c"}, branch = "main", }, filetype = "blade" } vim.filetype.add({ pattern = { ['.*%.blade%.php'] = 'blade', } }) require(plug.main).setup(config); end, }