@@ -7,7 +7,20 @@ return {
77 { " machakann/vim-sandwich" , enabled = false },
88 {
99 " echasnovski/mini.surround" ,
10- event = " User AstroFile" ,
10+ keys = function (plugin , keys )
11+ -- Populate the keys based on the user's options
12+ local mappings = {
13+ { plugin .opts .mappings .add , desc = " Add surrounding" , mode = { " n" , " v" } },
14+ { plugin .opts .mappings .delete , desc = " Delete surrounding" },
15+ { plugin .opts .mappings .find , desc = " Find right surrounding" },
16+ { plugin .opts .mappings .find_left , desc = " Find left surrounding" },
17+ { plugin .opts .mappings .highlight , desc = " Highlight surrounding" },
18+ { plugin .opts .mappings .replace , desc = " Replace surrounding" },
19+ { plugin .opts .mappings .update_n_lines , desc = " Update `MiniSurround.config.n_lines`" },
20+ }
21+ mappings = vim .tbl_filter (function (m ) return m [1 ] and # m [1 ] > 0 end , mappings )
22+ return vim .list_extend (mappings , keys )
23+ end ,
1124 opts = {
1225 mappings = {
1326 add = prefix .. " a" , -- Add surrounding in Normal and Visual modes
0 commit comments