visual-studio-codevscode-git

How can I open an editor gutter's inline diff peek view in VS Code with keyboard shortcut?


In VS Code there's information in the gutter regarding the git status of each line, that looks like so: enter image description here If you click in the gutter, this expands a menu that shows the diff locally, like so: enter image description here

Is there any way to open the previous menu without clicking on it, and instead using a keyboard shortcut in the line where the cursor is located?

There are shortcuts to cycle through the different changes, but I want something that would open up this menu on the specific line, not something that would force me to circle around the document to end up in the place I was originally. I've searched in the settings, online documentation and forums and came out empty handed.


Solution

  • You might want to check / add shortcuts for these commands:

    editor.action.dirtydiff.next - Alt+F3
    editor.action.dirtydiff.previous - Shift+Alt+F3
    

    These are the default keybinds but you can modify.