How can I set shortcuts for it? Is it possible of using only one shortcut for toggling between two views Git Open Changes and Open file. Ideally, use only one shortcut for open changes and open file. When in the file it'll know to call open changes and vice versa, when in working tree version it'll call open file.
I'm jumping between files and its Working Tree version by command palettes: Git: Open Changes and Git: Open file
I've found a way!
Open your keybindings.json (How to open)
Add these config:
...
{
"key": "ctrl+shift+q",
"command": "git.openFile",
"when": "editorFocus && isInDiffEditor"
},
{
"key": "ctrl+shift+q",
"command": "git.openChange",
"when": "editorFocus && !isInDiffEditor"
}
Now your vscode will work with ctrl+shift+q shortcut. Change to your shortcut.
You can set a shortcut for any command.
File > Preferences > Keyboard Shortcuts or (Mac) Code > Preferences > Keyboard Shortcuts
Type the command you want to set a shortcut for to quickly bring it to the top and click the "+" button at the far left of the column and set the shortcut.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With