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

Consider adding keyboard shortcut in VS Code extension to run shiny app #3

Open
parmsam opened this issue Aug 26, 2022 · 2 comments
Open

Comments

@parmsam
Copy link

parmsam commented Aug 26, 2022

Thanks for the VS Code extension. It would be nice if there was a default keyboard shortcut to shiny.python.runApp. The shortcut could be the same as the render or preview Quarto extension shortcut ( Ctrl+Shift+K or Ctrl+Shift+L). Edit: I realized after posting that this issue should belong in the vscode extension repo which doesn't appear to be public at this time. Please close this issue if it is already being addressed.

@jcheng5 jcheng5 transferred this issue from posit-dev/py-shiny Oct 5, 2022
@gadenbuie
Copy link
Collaborator

gadenbuie commented Apr 2, 2024

This is a great idea, here's how you can do this yourself. Use the command palette to open "Preferences: Open keyboard shortcuts (JSON)". Then add the following JSON snippet to map the "shiny.python.runApp" command to Cmd/Ctrl + Shift + K:

  {
    "key": "cmd+shift+k",
    "command": "shiny.python.runApp",
    "when": "shiny.python.active"
  },

Edit: and after the next version of the extension is released you can do the same for Shiny for R apps:

  {
    "key": "cmd+shift+k",
    "command": "shiny.r.runApp",
    "when": "shiny.r.active"
  },

@gadenbuie gadenbuie added this to the v0.2.0 milestone Apr 24, 2024
@gadenbuie
Copy link
Collaborator

If we like Cmd + Shift + K, we could add it to the extension. There's some precedent in RStudio for Cmd + Shift + S, but in VS Code this action feels well-aligned with "Quarto preview" and the shortcut it'd be overriding is likely less popular ("Save file as" (S) vs "Delete line" (K)).

@gadenbuie gadenbuie removed this from the v0.2.0 milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants