From 7bca70bee70725cc8a935fd8473b6811c2dad6a2 Mon Sep 17 00:00:00 2001 From: asep komarudin Date: Wed, 22 Feb 2023 10:52:37 +0700 Subject: [PATCH] support wichkey custom --- lua/custom/whichkey.lua | 7 +++++++ lua/user/whichkey.lua | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 lua/custom/whichkey.lua diff --git a/lua/custom/whichkey.lua b/lua/custom/whichkey.lua new file mode 100644 index 0000000..01e41c5 --- /dev/null +++ b/lua/custom/whichkey.lua @@ -0,0 +1,7 @@ +return { + -- contoh penambahan + -- ["k"] = { + -- name = "Example", + -- k = { 'lua print("Testing")', "Example" }, + -- }, +} diff --git a/lua/user/whichkey.lua b/lua/user/whichkey.lua index 9675e85..beccac3 100644 --- a/lua/user/whichkey.lua +++ b/lua/user/whichkey.lua @@ -396,6 +396,15 @@ local mappings = { ["o"] = { "SymbolsOutline", "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.register(mappings, opts) +which_key.register(wkey, opts) which_key.register(mappings2, opts2)