Shortcut to focus on Changes in Visual Studio Code Git source control manager

Viewed 382

There is some keyboard shortcut to move the cursor on the Changes section of the Visual Studio Code Git source control manager? It would be very helpful to navigate through the modified and staged files.

For example, in the following screenshot, I would like to move the cursor without using the mouse on gulpfile.js, so to be able to navigate the Changes section.

enter image description here

The default shortcut provided by Visual Studio Code to focus on source control view moves the cursor on the commit area message and it seems that it's not possible to jump to the Changes from there.

Any idea?

1 Answers

The only partial solution I've found is using the workbench.scm.focus command. If you have the commit message focused, you can hit "shift+tab" and then down arrow into your changes. Arrow keys aren't the best, but if you have a kinesis advantage 2 or similar keyboard using them is somewhat reasonable.

I was planning to create an extension to do this, but I don't think it's possible with the current extension API to mess with focus on an existing TreeView.

I also tried using GitLens and using its compareWithHead command, but I can't get that to refresh without using my mouse. The refresh command that exists only repaints the compare view instead of making a new call to git.

Hopefully this helps someone!

Related