cheatsheet.nvim
cheatsheet.nvim copied to clipboard
Integration with folke/whichkey.nvim?
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.
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 !
For reference, this is the way to do it - https://github.com/folke/which-key.nvim/issues/96#issuecomment-863162064. I'll get around to it soon (PRs also welcome :P)
@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
@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 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.
@Corey-Keller I've added add_cheat
in 5be58ae:
https://github.com/sudormrfbin/cheatsheet.nvim/blob/5be58aeabdf65034c9636e3c6f4f43de5ea93932/lua/cheatsheet/init.lua#L58-L64