+
+ { "echasnovski/mini.ai",
+ -- TODO: port vim text objects over
+ event = "VeryLazy",
+ opts = function()
+ local ai = require("mini.ai")
+ return {
+ n_lines = 500,
+ custom_textobjects = {
+ o = ai.gen_spec.treesitter({ -- code block
+ a = { "@block.outer", "@conditional.outer", "@loop.outer" },
+ i = { "@block.inner", "@conditional.inner", "@loop.inner" },
+ }),
+ f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }), -- function
+ c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }), -- class
+ t = { "<([%p%w]-)%f[^<%w][^<>]->.-</%1>", "^<.->().*()</[^/]->$" }, -- tags
+ d = { "%f[%d]%d+" }, -- digits
+ e = { -- Word with case
+ { "%u[%l%d]+%f[^%l%d]", "%f[%S][%l%d]+%f[^%l%d]", "%f[%P][%l%d]+%f[^%l%d]", "^[%l%d]+%f[^%l%d]" },
+ "^().*()$",
+ },
+ u = ai.gen_spec.function_call(), -- u for "Usage"
+ U = ai.gen_spec.function_call({ name_pattern = "[%w_]" }), -- without dot in function name
+ },
+ }
+ end,
+ },
+ { "numToStr/Comment.nvim",
+ dependencies = {
+ { "JoosepAlviste/nvim-ts-context-commentstring", -- nested language commenting (f.ex markdown code blocks)
+ opts = { enable_autocmd = false, },
+ }
+ },
+ opts = function(_, opts)
+ local tscci = require('ts_context_commentstring.integrations.comment_nvim')
+ vim.tbl_deep_extend('force', opts, {
+ toggler = {
+ line = "gcc",
+ block = "gbb",
+ },
+ mappings = {
+ basic = true,
+ extra = true,
+ },
+ pre_hook = tscci.create_pre_hook()
+ })
+ return opts
+ end,
+ },
+ { "danymat/neogen", -- Generate annotations like doxygen
+ cmd = "Neogen",
+ keys = {
+ { "<leader>cn", function() require("neogen").generate() end, desc = "Generate Annotations (Neogen)", },
+ },