-
Notifications
You must be signed in to change notification settings - Fork 312
feat(keymaps): implemented more detailed descriptions #2282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
By default all keymaps got the description `blink.cmp` for someone new to the keymaps (like me) it's very helpful to with a tool like Telescope be able to quickly look up what keymaps do. Hence the description is very important to provide the detail. Logic has been added to generate a description in the format: ``` Blink: command_1, command_2, ... (mode) ``` This is just a very quick solution implemented which is good enough for me, as far as im aware this change is self contained and affects essentially nothing other than the descriptions.
This is to pass the stylua check
|
Neat thanks! I'd prefer to map the command to human readable with just a basic |
|
@saghen Thanks for the response!
That is an elegant solution, I'll switch to that.
Makes sense. I will update the PR with these changes shortly. I do have some questions. Currently For anonymous functions, I went with a default string of "Custom" to be added, is this prefered? I was thinking I could implement support for a tuple format like I could add support while keeping backward compatibility, if you think that adds value. if command == 'fallback' or command == 'fallback_to_mappings' then
-- ...
elseif type(command) == 'function' then
-- ...
elseif type(command) == 'table' and type(command[1]) == 'function' then
-- ...
elseif require('blink.cmp')[command]() then
-- ...
end |
- Instead if using a predefined table, the readable names are instead generated by simply substituting '_' with space, then captilize the first letter of each token. - Changed prefix to instead be `blink.cmp: ` - Removed mode subfix
|
"Custom" for functions and excluding the fallbacks works with me. I don't think we should support descriptions on functions, since we'd remove it shortly with v2's cmp.keymap.set where we can support descriptions explicitly. |
- Update comment for clarity - Abbreviate '<Custom Function>' to '<Custom Fn>' to save UI space
By default all keymaps got the description
blink.cmpfor someone new to the keymaps (like me) it's very helpful to with a tool like Telescope be able to quickly look up what keymaps do. Hence the description is very important to provide the detail.Logic has been added to generate a description in the format:
This is just a very quick solution implemented which is good enough for me, as far as im aware this change is self contained and affects essentially nothing other than the descriptions.
(draft for #2281)