feat(which-key): easier integration for which-key group names

This commit is contained in:
Folke Lemaitre 2023-04-16 21:33:55 +02:00
parent 29ec138f8e
commit df94a044ec
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 18 additions and 10 deletions

View file

@ -218,11 +218,7 @@ return {
event = "VeryLazy",
opts = {
plugins = { spelling = true },
},
config = function(_, opts)
local wk = require("which-key")
wk.setup(opts)
local keymaps = {
defaults = {
mode = { "n", "v" },
["g"] = { name = "+goto" },
["gz"] = { name = "+surround" },
@ -239,11 +235,12 @@ return {
["<leader>u"] = { name = "+ui" },
["<leader>w"] = { name = "+windows" },
["<leader>x"] = { name = "+diagnostics/quickfix" },
}
if Util.has("noice.nvim") then
keymaps["<leader>sn"] = { name = "+noice" }
end
wk.register(keymaps)
},
},
config = function(_, opts)
local wk = require("which-key")
wk.setup(opts)
wk.register(opts.defaults)
end,
},