[mini.clue] How to get clues for a key mapped to another key? #2028
-
Contributing guidelines
Module(s)mini.clue QuestionHi, thanks for making this! I've been trying vim.keymap.set('n', '<leader>w', '<C-w>', { desc = '+Window' })I can't seem to get the |
Beta Was this translation helpful? Give feedback.
Answered by
drowning-cat
Sep 28, 2025
Replies: 1 comment 2 replies
-
|
It can be done in user-space configuration, but it is not an ideal solution: vim.keymap.set("n", "<Leader>w", "<C-w>", { desc = "+Window" })
local windows_clue = function(trigger, opts)
local clues = MiniClue.gen_clues.windows(opts)
if trigger then
for _, clue in ipairs(clues) do
clue.keys = string.gsub(clue.keys, "^<C%-w>", trigger)
end
end
return clues
end
local MiniClue = require("mini.clue")
MiniClue.setup({
triggers = {
{ mode = "n", keys = "<C-w>" },
{ mode = "n", keys = "<Leader>w" },
},
clues = {
windows_clue(),
windows_clue("<Leader>w"),
},
}) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
echasnovski
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It can be done in user-space configuration, but it is not an ideal solution: