Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In VSCode, is there a command to navigate from a diff view to the local file

Let's say I've clicked on a file in the Git changes view and it opened a diff. I realize I can (usually) edit that file on the right side of the diff.

Is there a command that will open the right hand (local) file in it's own editor, as if I had clicked on it in the Explorer?

like image 721
burton Avatar asked Nov 27 '25 14:11

burton


2 Answers

The command is git.openFile. You can add a custom keybinding, for example to f4:

    {
        "key": "f4",
        "command": "git.openFile",
        "when": "isInDiffEditor"
    }
like image 127
ce72 Avatar answered Nov 30 '25 04:11

ce72


Do you consider the Open File icon to the right of the file name a command? I'm not familiar with any other way to do it.

enter image description here

like image 26
Soc Avatar answered Nov 30 '25 04:11

Soc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!