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
Conversation
git.stageSelectedRanges -> ctrl + k, ctrl + alt + s git.unstageSelectedRanges -> ctrl + k, ctrl + u git.revertSelectedRanges -> ctrl + k, ctrl + r Closes microsoft#93564
@@ -411,6 +411,23 @@ | |||
"category": "Git" | |||
} | |||
], | |||
"keybindings": [ |
There was a problem hiding this comment.
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
"mac": "shift+cmd+v", |
@ChrisPapp Thanks for creating a PR for this. I have left a comment in the code which you should tackle for now. |
@isidorn Please take over this. |
@ChrisPapp assigning this to April, which means we will merge it starting of next week. Can you please tackle my comment until then? Thanks |
Use command key instead of ctrl on Mac
@isidorn |
That conflict is fine. All keybindins are taken in vscode you have to have some conflicts. Thanks for adding keybinding for mac, I will checkout the PR next week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment
{ | ||
"command": "git.revertSelectedRanges", | ||
"key": "ctrl+k ctrl+r", | ||
"mac": "cmd+k cmd+r", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"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.
There was a problem hiding this comment.
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?
Good job with this PR, let's go with these keybdingins and we'll see if we should change them due to conflicts. |
This PR fixes #93564
Created default keybindings for the following commands
Git: Stage Selected Ranges -> ctrl + k, ctrl + alt + s
Git: Unstage Selected Ranges -> ctrl + k, ctrl + u
Git: Revert Selected Ranges -> ctrl + k, ctrl + r
Note:
ctrl + k, ctrl + u is also used by "Remove Line Comment". "Unstage Selected Ranges" now overrides it, however similar functionality can be achieved by using "Toggle Line Comment" (ctrl + /)