question: using replace.desc to format non-group key descriptions?
#1016
Unanswered
lloyd-pinrun
asked this question in
Q&A
Replies: 1 comment
-
|
Also what I thought would work didn't... realized in retrospect it only affects my custom defined |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As the title implies, I'm curious if there's a way to explicitly format the
descof a keymap for non-groups by way of thewk.Optsfieldreplace.desc?For example doing something like the following, all descriptions get "replaced"/formatted including
keysonly set asgroups:{ "folke/which-key.nvim", opts = { replace = { desc = function(description) return "test: " .. desc end } } }It looks like
require("which-key.view").replacepass through anything else to any provided functions other than the value of the key being replaced, e.g.descorkey(according to the docs), so I assume there'd be nothing for me to use to determine if thedescbelongs to a group or an non-group mapping. I guess you could potentially check if the value I'm formatting is not an existing group 🤔, e.g.:I'm gonna try this rq, but tbh this is probably the answer to my question 😅
Beta Was this translation helpful? Give feedback.
All reactions