diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua index c18f162..01f74f7 100644 --- a/.config/nvim/lua/plugins/treesitter.lua +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -38,6 +38,18 @@ return { 'echasnovski/mini.ai', event = "VeryLazy", version = false, - opts = {} + dependencies = { + 'nvim-treesitter/nvim-treesitter-textobjects' + }, + config = function() + local gen_spec = require('mini.ai').gen_spec + require('mini.ai').setup({ + custom_textobjects = { + -- Function definition (needs treesitter queries with these captures) + F = gen_spec.treesitter({ a = '@function.outer', i = '@function.inner' }), + }, + n_lines = 1000 + }) + end }, }