visual-studio-codekeyboard-shortcutsdiff

Is there a keyboard shortcut to switch between the left-hand side and right-hand side of a diff/compare-two-files editor?


I love using VS Code with the vscode-vim extension as I can do most editing without the mouse. But whenever I'm looking at a diff view (by clicking a file with changes in the SCM/git pane) or an editor that's comparing two files (by running "Compare Active File With..." command), I need to use the mouse to switch between the left and right sides (i.e. the "old" and "new" versions of the change). This is annoying because I frequently compare two files and want to merge them by copying segments with changes from one file to the other, which needs me to switch back and forth in the compare view. Does anyone know if there's a keyboard shortcut, or a command I can bind a new keyboard shortcut to, for this?


Solution

  • Edit (Nov 11, 2020, thanks to @Mark):

    workbench.action.compareEditor.focusPrimarySide, workbench.action.compareEditor.focusSecondarySide and workbench.action.compareEditor.focusOtherSide have been added to VS Code. Should be in v1.52


    It's an official feature request now, so please upvote it if you want to see this in VS Code: https://github.com/microsoft/vscode/issues/95068