In case someone is still looking for this:
The commands stageSelectedRanges, unstageSelectedRanges, revertSelectedRanges were introduced some time ago. Please note that there is currently a related error in VSCode: after an incomplete stage, the update is not updated ( https://github.com/Microsoft/vscode/issues/26642 ), but except that it works like a charm.
This is how I set it up in my key bindings:
{ "key": "s", "command": "git.stageSelectedRanges", "when": "isInDiffEditor && editorTextFocus" }, { "key": "u", "command": "git.unstageSelectedRanges", "when": "isInDiffEditor && editorTextFocus" }, { "key": "r", "command": "git.revertSelectedRanges", "when": "isInDiffEditor && editorTextFocus" }
source share