54

Is it possible to change the default behavior in VSCode so that when I'm in the Source control window and I click on a file in the left pane, the file opens in the right pane instead of the changes window? I see that if I right click a file I can choose to open it instead of the changes window but I'm lazy and just want to click once.

1 Answer 1

127

There is an icon which will let you open file itself without needing to right click: enter image description here

It is also possible to change default behavior when left-clicking on the file name since version 1.30:

To change it, set in your settings.json:

"git.openDiffOnClick": false

If you set it, the logic will inverse. Now, clicking on a file name will open the file, and clicking on the "inline icon" will open the diff.

It is also possible to disable this inline icon completely with:

"git.showInlineOpenFileAction": false
3
  • 4
    Is it possible to Open FIle from source control like Ctrl-clicking on it or so while still openning Diff on simple click? Or maybe set a shortcut for it like Ctrl+Shift+G + Ctrl+O?
    – kolyaseg
    Commented Jul 4, 2023 at 12:59
  • 1
    @kolyaseg would be indeed best option
    – abernier
    Commented Oct 29, 2023 at 7:47
  • 1
    @kolyaseg It's possible to create a key binding to open the file from the diff. To add the shortcut, go to Cog > Keyboard Shortcuts and filter on git.openFile. Alternatively, you can manually add something like this to keybindings.json: [ { "key": "alt+z", "command": "git.openFile" } ]. The other way around (from regular view to diff view) is also possible using git.openChange.
    – qadzek
    Commented Mar 6 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.