mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-28 11:40:07 +02:00
support wichkey custom
This commit is contained in:
parent
14d70c6a17
commit
7bca70bee7
2 changed files with 16 additions and 0 deletions
7
lua/custom/whichkey.lua
Normal file
7
lua/custom/whichkey.lua
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
return {
|
||||||
|
-- contoh penambahan
|
||||||
|
-- ["k"] = {
|
||||||
|
-- name = "Example",
|
||||||
|
-- k = { '<cmd>lua print("Testing")<cr>', "Example" },
|
||||||
|
-- },
|
||||||
|
}
|
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue