0

When I select a file from the source control panel (in my instance I'm using git), it then opens the side-by-side changes for that file.

I'm aware you can edit the file on the right hand side, but is there a quick way to close the open tab and open the original file itself? Preferably a keyboard shortcut.

1

1 Answer 1

0

The shortcut I'm presenting as a solution is slightly long but will work for sure.

As soon as you open the file from the source control panel use the following shortcuts to copy the file's relative path

Windows/Linux ctrl+k Mac cmd+k immediately followed by ctrl+shift+c \ cmd+shift+c

This will copy the relative path of the file you can then use the command ctrl+f4 / cmd+f4 to close the opened history view of the file

then open the command palette using ctrl+shift+p / cmd+shift+p and remove the > character and paste the relative path of the file using ctrl+v / cmd+v

When you open the file in the diff view take care not to click the cursor within the editor as this will move to editor focus. When in editor focus the command to copy the relative path will not work. However this can be fixed by changing this in the keyboard shortcut settings.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.