simonpcouch / pal

LLM assistants for R
https://simonpcouch.github.io/pal/
Other
5 stars 3 forks source link

mechanism to register keybindings #6

Closed simonpcouch closed 1 week ago

simonpcouch commented 2 weeks ago

I think, ultimately, the interface I'd like to have is something like:

pal("cli", "Ctrl+Shift+C")

To effectively register keybindings in RStudio, this requires that both:

1) The pal is registered as an add-in 2) The pal is able to bind that add-in to a keybinding

Neither are officially supported in the IDE. 🫠

simonpcouch commented 2 weeks ago

Maybe modifyKeyboardShortcuts at https://docs.posit.co/ide/server-pro/reference/rstudio_ide_commands.html via rstudioapi::executeCommand().

simonpcouch commented 2 weeks ago

This file shows an example of setting default keybindings via json—pal could just use the traditional add-in mechanism and then apply this kind of json on restart?

https://github.com/biof309/spring2019/blob/884b074e7cdc8ec8e8e6b58a9d37c3996c6ba1fd/setup/rstudio_bindings.json#L2

simonpcouch commented 2 weeks ago

May be lower-friction in Positron: https://code.visualstudio.com/api/extension-guides/command#creating-new-commands

simonpcouch commented 2 weeks ago

https://github.com/posit-dev/positron/issues/1313

simonpcouch commented 2 weeks ago

https://github.com/posit-dev/positron/discussions/3686#discussioncomment-9905537

simonpcouch commented 1 week ago

Closing in favor of #22, though the linked issues may be helpful there.

simonpcouch commented 1 week ago

Reopening-- https://github.com/gadenbuie/shrtcts.