-
Notifications
You must be signed in to change notification settings - Fork 28.8k
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
Git: Provide single shortcut for "Stage Changes"/"Unstage Changes" #44592
Comments
(Experimental duplicate detection) |
@birgersp How did you configure those keybindings? Can you show me your keybindings.json? |
@joaomoreno Thanks for getting back to me so quickly! I configured the keybindings by opening the keybindings editor with "File"->"Preferences"->"Keyboard Shortcuts". Then I double-clicked the "Stage Changes" command, and pressed CTRL+T followed by ENTER to assign it. Did the same for "Unstage Changes". My keybindings.json file looks like this:
|
Got it. What would your prefer to happen if the file is both staged and modified in the working tree? |
Notice that the command doesn't know about selection, only about the currently opened file. There's no current API to get a hold of that selection. |
Understood. Personally, I don't have any opinion as to what should happen if the file is both staged and unstaged. |
I suggest we just stage it. |
I actually wanted to see whether there are hidden [
{
"key": "ctrl+t",
"command": "git.stage",
"when": "inDiffEditor" // only for illustrative purposes, i don't know if there is a when clause for this mode
},
{
"key": "ctrl+t",
"command": "git.unstage",
"when": "inDiffEditor && inStagedView" // only for illustrative purposes, i don't know if there is a when clause for this mode
}
] |
@kumarharsh: Found anything about that |
Nopes ☹. The core team needs to answer this. |
@kumarharsh Maybe try something like |
This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider. If you wonder what we are up to, please see our roadmap and issue reporting guidelines. Thanks for your understanding and happy coding! |
I personally prefer to use the same keyboard shortcut for both "Stage Changes" and "Unstage Changes".
If I set the same keyboard shortcut for both, only one of them (namely, "Stage Changes") is enabled.
The text was updated successfully, but these errors were encountered: