Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code - Keyboard shortcut to open Git hunk change preview?

Currently if I want to open the Git hunk change preview, I need to move my mouse and click on the gutter to open the preview window:

opening hunk preview

How can I add a keyboard shortcut such that it opens the preview window if I use it while my cursor is within the hunk?

{
  "key": "F12",
  "command": /* ??? */,
  "when": /* ??? */
},
like image 953
AnsonH Avatar asked Oct 14 '25 04:10

AnsonH


1 Answers

I just tested Alt+F3

It is the keyboard shortcut for "Show Next Change", and it opens the diff hunk.
But you still have to click in the diff view in order to shift focus from the editor.

like image 133
VonC Avatar answered Oct 18 '25 23:10

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!