support wichkey custom

This commit is contained in:
asep komarudin 2023-02-22 10:52:37 +07:00
parent 14d70c6a17
commit 7bca70bee7
2 changed files with 16 additions and 0 deletions

7
lua/custom/whichkey.lua Normal file
View file

@ -0,0 +1,7 @@
return {
-- contoh penambahan
-- ["k"] = {
-- name = "Example",
-- k = { '<cmd>lua print("Testing")<cr>', "Example" },
-- },
}

View file

@ -396,6 +396,15 @@ local mappings = {
["o"] = { "<cmd>SymbolsOutline<cr>", "Symbol Outline" }, ["o"] = { "<cmd>SymbolsOutline<cr>", "Symbol Outline" },
} }
local wkey = {}
local data_exists, key = pcall(require, "custom.whichkey")
if data_exists then
if type(key) == "table" then
wkey = key
end
end
which_key.setup(setup) which_key.setup(setup)
which_key.register(mappings, opts) which_key.register(mappings, opts)
which_key.register(wkey, opts)
which_key.register(mappings2, opts2) which_key.register(mappings2, opts2)