Skip to content
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

Integration with folke/whichkey.nvim? #4

Open
macintacos opened this issue Jun 6, 2021 · 6 comments
Open

Integration with folke/whichkey.nvim? #4

macintacos opened this issue Jun 6, 2021 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@macintacos
Copy link

I'm getting my mappings set up in https://github.com/folke/which-key.nvim and was just thinking how nice it'd be if this integrated with which-key.nvim so that I could define my keymaps there and be able to search the labels of the keybindings that are given there with this tool. If I use cheatesheet.nvim, I'd basically need to be typing out those descriptions twice, and I'd love it if I could save myself the hassle 🙂

I understand that this kinda goes against the premise, however it feels like a fit that would "make sense" and be an awesome convenience for the folks who've already spent a bunch of time getting their which-key configs set up.

@sudormrfbin
Copy link
Owner

I was thinking about this a few days back and it slipped through my mind :P. As you said it'll make for a smoother experience overall. Thank you for opening an issue !

@sudormrfbin sudormrfbin added enhancement New feature or request help wanted Extra attention is needed labels Jun 7, 2021
@sudormrfbin
Copy link
Owner

For reference, this is the way to do it - folke/which-key.nvim#96 (comment). I'll get around to it soon (PRs also welcome :P)

@Corey-Keller
Copy link

@sudormrfbin Is there any existing (or planned) mechanism for adding cheatsheet entries from lua?

My thought being something like: require('cheatsheet.nvim').add_cheat(description, cheatcode) to just add it to the existing table of entries

@sudormrfbin
Copy link
Owner

@Corey-Keller There is no existing way to do it, but it shouldn't be too hard to add. Can you share a use case for it though ? Do you want to programmatically set them on startup or something similar ?

@Corey-Keller
Copy link

@Corey-Keller There is no existing way to do it, but it shouldn't be too hard to add. Can you share a use case for it though ? Do you want to programmatically set them on startup or something similar ?

Pretty much yeah. This issue itself is a pretty good use case actually. Get all the mappings from which-key.nvim, and then run through them to add to cheatsheet.

@sudormrfbin
Copy link
Owner

@Corey-Keller I've added add_cheat in 5be58ae:

-- Add a cheat which will be shown alongside cheats loaded from cheatsheet files.
-- @param description: string
-- @param cheatcode: string
-- @param section: string
-- @param tags: array of alternative names for the section
-- TODO: Cheats added this way are not shown in the floating window, only telescope
M.add_cheat = function(description, cheatcode, section, tags)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants