return { 'nvim-treesitter/nvim-treesitter', dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects', }, build = ':TSUpdate', -- This needs to be manually pased into config and used in the function(_, opts) -- as it has to be configured with the required...'.config' opts = { ensure_installed = { 'bash', 'ini', 'go', 'lua', 'python', 'typescript', 'vimdoc', 'vim', 'css', 'html', 'markdown', 'markdown_inline', 'php', 'sql', 'gdscript', 'godot_resource' }, auto_install = false, highlight = { enable = true }, indent = { enable = true, disable = { 'python', 'css',}, }, incremental_selection = { enable = true, keymaps = { init_selection = '', node_incremental = '', node_decremental = '', scope_incremental = '', }, }, textobjects = { select = { enable = true, -- Automatically jump forward to textobj, similar to targets.vim lookahead = true, include_surrounding_whitespace = false, keymaps = { -- You can use the capture groups defined in textobjects.scm -- The descriptions are simplistic to match the native descriptions ['aa'] = { query = '@parameter.outer', desc = 'a parameter' }, ['ia'] = { query = '@parameter.inner', desc = 'a parameter' }, ['af'] = { query = '@function.outer', desc = 'a function' }, ['if'] = { query = '@function.inner', desc = 'a function' }, ['ac'] = { query = '@class.outer', desc = 'a class' }, ['ic'] = { query = '@class.inner', desc = 'a class' }, }, }, -- TODO: change these keymaps to better ones move = { enable = true, -- Whether to set jumps in the jumplist set_jumps = true, goto_next_start = { [']m'] = '@function.outer', [']]'] = '@class.outer', }, goto_next_end = { [']M'] = '@function.outer', [']['] = '@class.outer', }, goto_previous_start = { ['[m'] = '@function.outer', ['[['] = '@class.outer', }, goto_previous_end = { ['[M'] = '@function.outer', ['[]'] = '@class.outer', }, }, -- TODO: probably change to sa (swap argument) swap = { enable = true, swap_next = { ['a'] = { query = '@parameter.inner', desc = 'Swap with next parameter' }, }, swap_previous = { ['A'] = { query = '@parameter.inner', desc = 'Swap with previous parameter' }, }, }, }, }, config = function(_, opts) require('nvim-treesitter.configs').setup(opts) end, }