2022-05-29 09:38:53 +00:00
|
|
|
local present, wk = pcall(require, "which-key")
|
2022-05-25 07:06:58 +00:00
|
|
|
|
2022-05-29 09:38:53 +00:00
|
|
|
if not present then
|
|
|
|
return
|
|
|
|
end
|
2022-05-12 12:56:01 +00:00
|
|
|
|
2022-05-29 09:38:53 +00:00
|
|
|
local options = {
|
2022-05-12 12:56:01 +00:00
|
|
|
|
|
|
|
icons = {
|
|
|
|
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
|
|
|
|
separator = " ", -- symbol used between a key and it's label
|
|
|
|
group = "+", -- symbol prepended to a group
|
|
|
|
},
|
|
|
|
|
|
|
|
popup_mappings = {
|
|
|
|
scroll_down = "<c-d>", -- binding to scroll down inside the popup
|
|
|
|
scroll_up = "<c-u>", -- binding to scroll up inside the popup
|
|
|
|
},
|
|
|
|
|
|
|
|
window = {
|
|
|
|
border = "none", -- none/single/double/shadow
|
|
|
|
},
|
|
|
|
|
|
|
|
layout = {
|
|
|
|
spacing = 6, -- spacing between columns
|
|
|
|
},
|
|
|
|
|
|
|
|
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " },
|
|
|
|
|
|
|
|
triggers_blacklist = {
|
|
|
|
-- list of mode / prefixes that should never be hooked by WhichKey
|
|
|
|
i = { "j", "k" },
|
|
|
|
v = { "j", "k" },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2022-05-29 10:37:47 +00:00
|
|
|
options = require("core.utils").load_override(options, "folke/which-key.nvim")
|
2022-05-26 15:49:13 +00:00
|
|
|
|
2022-05-29 10:37:47 +00:00
|
|
|
local utils = require "core.utils"
|
|
|
|
|
|
|
|
local mappings = utils.load_config().mappings
|
2022-05-29 09:38:53 +00:00
|
|
|
local mapping_groups = { groups = vim.deepcopy(mappings.groups) }
|
2022-05-22 11:06:24 +00:00
|
|
|
|
2022-05-29 09:38:53 +00:00
|
|
|
mappings.disabled = nil
|
|
|
|
mappings.groups = nil
|
2022-05-21 07:03:19 +00:00
|
|
|
|
2022-05-29 10:37:47 +00:00
|
|
|
utils.load_mappings(mapping_groups)
|
2022-05-16 12:31:47 +00:00
|
|
|
|
2022-05-29 09:38:53 +00:00
|
|
|
wk.setup(options)
|