Show git diff of the current line in vscode

67 views Asked by At

Is there a shortcut to show the git diff of the current line like it's done with the mouse in the GIF?enter image description here

I've tried to find this action in the key bindings, but it seems like it's not even an action. I've also tried to detect the appearing "window", but no luck. I've also tried to use GitLens, but it also doesn't allow you to set a shortcut to toggle hover of the current line.

1

There are 1 answers

1
Phil On BEST ANSWER

There's a hint on the right-hand side of the dialog that appears...

  • Show Next Change (⌥F3)
  • Show Previous Change (⬆⌥F3)

Pressing the first one when on a changed section will display the dialog for that section.

That's on macOS anyway. The Linux / Windows equivalents probably use ALT+F3.

From the default key mappings preferences

Command Keybinding When Source
Show Next Change F3 editorTextFocus && !textCompareEditorActive System
Show Previous Change F3 editorTextFocus && !textCompareEditorActive System