pogyomo / submode.nvim

Create your own submode
MIT License
41 stars 0 forks source link

automatically seal submode #23

Closed pogyomo closed 3 weeks ago

pogyomo commented 3 weeks ago

It may be good to automatically seal submode, as writing submode.seal may be forgot.

pogyomo commented 3 weeks ago

Change third argument of submode.create to take a function which take a function to register default mappings like below may be good.

submode.create("test", { mode = "n" }, function(default)
    default("1", function() vim.notify("1") end)
    default("2", function() vim.notify("2") end)
end)
-- test is sealed automatically
pogyomo commented 3 weeks ago

I think for backward compatible, submode.create should accept both function and mappings.