initially, I've made an overview of available methods, but I think this bit should be on top since it's the most useful one:
What I've came up with to make it quicker
As one can see, "Git: Stage Selected Ranges" shown by Command Palette (ctrl + shift + P
) for the main editor has the same hotkey as in the "review changes" interface, but it doesn't actually work. For some time, I thought this is a bug, but it turned out to be a configurable behavior: click the settings button:

(or just go ctrl + K ctrl + S
/file → preferences → keyboard shortcuts and search for @command:git.stageSelectedRanges
)
...and you'll see that by default the "When" expression is isInDiffEditor
, so it is not supposed to work in the normal editor. So, change When expression to empty:

And either keep the default hotkey combination and use it in the editor (that's what I did) or set it to something shorter (not a double-combination, I'll consider this too). Profit!
If something's unclear or you want to know other options, here's
The initial overview of available methods
basic method is to Stage Selected Ranges in the interface for reviewing changes:

- open Source Control (
ctrl + shift + G
)
- select file
- select lines that should be staged (or put a cursor for a single line or lines before and after deleted bits)
- open the "..." menu and select "Stage Selected Ranges"
on the other hand, you can use hotkeys. Default ones (in v1.56.2) are ctrl + K
and then ctrl + alt + S
. To set custom key combination, open Keyboard shortcuts (either from File → Preferences or via ctrl + K
then ctrl + S
) and find stageSelectedRanges
(and may be unstageSelectedRanges
, revertSelectedRanges
)
unfortunately, hotkeys mentioned above work only in the "review changes" interface, and you may want to do this in the code editor directly. You can do this via another interface: click the change label:

and then the "stage change" button:

despite there's no direct hotkeys to stage selected range from code editor, you can go ctrl + shift + P
(open Command Palette) and then type "stage s" and choose "Git: Stage Selected Ranges":

Also, it's handy to use Alt + F5
to jump to the next change in the file when you review what to stage.