Lazy loading on a keybind without making the keybind? #99
|
Some (many) plugins set their own keybinds, such as |
Replies: 3 comments 1 reply
|
Yeah, but you dont have to set the action It is enough to just do It will remove the trigger, load the spec (which will create the plugin's keybinds if it sets any), and then trigger the keysequence again after your spec hooks have ran, thus triggering the expected behavior of the keybind. |
|
In order to get the info automatically, you would need to run the plugins first and see what keybinds they create. Which obviously defeats the purpose of being lazy. You could maybe hook up some crazy caching solution to run it once, figure them out, save it for next time unless stuff changed, but that would have to be an extension made by someone else because that is way more effort than it is probably worth. In theory you could make a handler that does that but the cache invalidation sounds like a nightmare to get right. |
Thanks, thats what I was looking for. |
Yeah, but you dont have to set the action
It is enough to just do
keys = { "<leader>idk", "<leader>hi" }It will remove the trigger, load the spec (which will create the plugin's keybinds if it sets any), and then trigger the keysequence again after your spec hooks have ran, thus triggering the expected behavior of the keybind.