burton
burton

Reputation: 591

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?

Upvotes: 17

Views: 3590

Answers (4)

Narbhakshi
Narbhakshi

Reputation: 392

In my case I had set workbench.editor.editorActionsLocation settings to 'hidden'. Reverted it to the default fixed it.

"workbench.editor.editorActionsLocation": "default"

These were hidden

Upvotes: 1

ce72
ce72

Reputation: 413

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

    {
        "key": "f4",
        "command": "git.openFile",
        "when": "isInDiffEditor"
    }

Upvotes: 15

Mark
Mark

Reputation: 181359

It appears what you want is the new command workbench.action.compareEditor.openSide currently in the Insiders' Build v1.74.

If the right-hand side of the diff has focus then triggering that command will close the diff and open the right-hand side in its editor. And similarly if the left-hand side had focus.

Upvotes: 1

Soc
Soc

Reputation: 7780

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

Upvotes: 7

Related Questions