Closed EmilHvitfeldt closed 1 day ago
This is a duplicate of #2150 but maybe the right call is to move these keyboard shortcuts to the RStudio Keymap extension. This would not get rid of the actual problem (on hover, you see a keybinding that does not actually apply in your current situation) but it would mean that a) folks opt IN to using it and b) fewer users total would be in this situation.
Notes from the duplicate issue that I filed at https://github.com/posit-dev/positron/issues/2673:
We currently define a bunch of "cmd+shift+"
bindings in the R extension. These are high value bindings that are more likely to cause conflicts with existing Code/Positron bindings, for instance we bind "cmd+shift+e"
to check a package inside R projects which conflicts with the regular keybinding to show the file explorer.
Now that we have an RStudio keymap extenstion (https://github.com/posit-dev/positron/pull/2067) I think this frees us to come up with default keybindings that are less likely to conflict with the larger ecosystem. We could:
Move keybindings such as Cmd+Shift+E
from the positron-r extension to the RStudio-keymap extension.
Create new ones in positron-r that don't conflict with VS Code. These will be useful for those of us that primarily use VS Code shortcuts but still want a way to invoke R commands with the keyboard.
Since there are many commands and thus many keybindings, we might want to use the same approach as the Cmd+K
prefix key. For instance we could use Shift+Cmd+K
as a prefix key, then we'd have Shift+Cmd+K E
to check a package, Shift+Cmd+K B
to build one, etc.
(I see that Shift+Cmd+K
is used by Quarto for preview though, so we might need a different prefix.)
I've filed this issue in the RC milestone but I would personally bump it to Public Beta.
@hadley mentions Cmd+R would be an obvious prefix. It doesn't seem to be used for anything important:
During our private beta Q&A session, there was some discussion of folks who want to use the R package development shortcuts but not opt in to the RStudio keymap FWIW.
One reason Cmd + R isn't used for anything important is because it probably can't be remapped in the browser, since it's used for refresh.
I'm experimenting with this keymap. The Cmd+'
prefix is available and easy to type on qwerty. Feels good so far!
Is there any reasons we'd not be able to use this prefix?
Edit: We might want to namespace dev keybindings further in Cmd+' Cmd+D
. This way we can add a bunch of other usethis based commands within that namespace while keeping the main prefix available for other positron gestures. For instance I'd love:
Cmd+' Cmd+C
toggle consoleCmd+' Cmd+V
toggle variablesCmd+' Cmd+P
toggle plotsCmd+' Cmd+H
show help for object at pointCmd+' Cmd+.
console assists, e.g. quick-pick menu of customisable commands like print()
, summary()
or str()
for the object under cursor, see https://github.com/posit-dev/positron/issues/2974#issuecomment-2102575695We have collected a number of issues that are related to this problem where the UI always shows a built-in keybinding, even when that keybinding does not apply to that action. The user might end up looking at the UI and trying that keybinding, but it does something completely different. Let's use #2150 to track this problem.
Positron Version:
Positron Version: 2024.03.0 (Universal) build 893 Code - OSS Version: 1.87.0 Commit: 864257d0a5e7131c1c3bbe891deefc09b3811f47 Date: 2024-03-05T03:24:32.501Z Electron: 27.3.2 ElectronBuildId: undefined Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Darwin arm64 23.3.0
Steps to reproduce the issue:
https://github.com/posit-dev/positron/assets/14034784/8ec3c921-16aa-4b29-bf27-14aa6f7aa11b
What did you expect to happen?
Some of the listed keybindings on hover doesn't work because they are superseded by R package development commands.
I don't know if it would possible to hide the incorrect shortcuts.
As far as I can tell, I don't have any custom keybindings, so this is vanilla
Were there any error messages in the output or Developer Tools console?
Nope