nvim: Update which-key mapping functions

Use new which-key mapping `.add()` functions after `.register()` has
been deprecated with which-key 3.0.0.
This commit is contained in:
Marty Oehme 2024-07-24 14:53:48 +02:00
parent d45d220b52
commit 7a051952fc
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
10 changed files with 46 additions and 49 deletions

View file

@ -94,10 +94,11 @@ local prose_plugs = {
"mickael-menu/zk-nvim",
config = function()
if require("core.util").is_available("which-key") then
local prefix = require("which-key").register
prefix({ ["<leader>n"] = { name = "+notes" } })
prefix({ ["<localleader>n"] = { name = "+note" } })
prefix({ ["<localleader>n"] = { name = "+note", mode = "v" } })
require("which-key").add({
{ "<leader>n", group = "notes" },
{ "<localleader>n", group = "note" },
{ "<localleader>n", group = "note", mode = "v" },
})
require("zk.commands").add("ZkOrphans", function(opts)
opts = vim.tbl_extend("force", { orphan = true }, opts or {})