In VS Code, when the source control view is focused, I want to focus the first file in "staged Changes", navigate and focus between them, is there a keyboard shortcut to do this?
I want the behavior works like "Search: Focus Next Search Result,Search: Focus Previous Search Result". but in source view stage section
2
Answers
This is pretty easy and fast with regular keyboard navigation.
You can switch to the source control pane with the
View: Show Source Control
command, or the corresponding ctrl+shift+g shortcut. Or if it’s already the current tab of the sidebar and the sidebar is not focused, focus it with ctrl+0.Once you have focused on the source control view, just press up or down until you reach it.
If the listing is not focused yet, and something else like the commit message input or commit button is focused instead, just press tab or shift+tab until it is.
You can do this directly from anywhere in the scm view, but you will need a macro extension like Multi-Command. And this keybinding:
When you are focused in the scm view you could go down/up a file and focus it with this keybinding:
To open the next item in the scm view and return focus to that scm view, try this keybinding: