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

Add default keybindings for stage/revert/unstage selected ranges #93706

Merged
merged 2 commits into from Apr 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions extensions/git/package.json
Expand Up @@ -411,6 +411,26 @@
"category": "Git"
}
],
"keybindings": [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add mac keybindings to use cmd instead of ctrl.
Example how markdown does it

{
"command": "git.stageSelectedRanges",
"key": "ctrl+k ctrl+alt+s",
"mac": "cmd+k cmd+alt+s",
"when": "isInDiffEditor"
},
{
"command": "git.unstageSelectedRanges",
"key": "ctrl+k ctrl+u",
"mac": "cmd+k cmd+u",
"when": "isInDiffEditor"
},
{
"command": "git.revertSelectedRanges",
"key": "ctrl+k ctrl+r",
"mac": "cmd+k cmd+r",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"mac": "cmd+k cmd+r",
"mac": "cmd+k cmd+alt+r",

macOS VS Code has CmdK CmdR as a builtin keyboard shortcut that opens this link: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf
I don't know about Linux and windows, but best not to conflict.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps if we do use alt, probably best to change revert for more uniformity?

"when": "isInDiffEditor"
}
],
"menus": {
"commandPalette": [
{
Expand Down