DEV Community

Cover image for Keyboard Driven VSCode

Keyboard Driven VSCode

Waylon Walker on November 19, 2019

Throw that mouse Away its time to setup some keyboard shortcuts. Quick side note. This is a cross post from my personal blog at https://waylonw...
Collapse
 
gorvgoyl profile image
Gourav

Very nice keyboard hacks. Here's how I use it:
1) Single shortcut (Ctrl+j) to open/close terminal + also set the focus in terminal. It works out of the box. :D

2) Single shortcut (ctrl+l) to toggle focus between all opened editors, it also works even if focus is on terminal:
{
"key": "ctrl+l",
"command": "workbench.action.focusNextGroup",
"when": "editorFocus"
},
{
"key": "ctrl+l",
"command": "workbench.action.focusActiveEditorGroup",
"when": "!editorFocus"
},

3) open/close sidebar (ctrl+b).

Apart from these my best keyboard hack is modified keyboard win key as mouse left click using autohotkey software and I never touched the mouse again in my life.

Collapse
 
waylonwalker profile image
Waylon Walker

That is awesome! I use the win key for too many shortcuts, I would need to find a different hotkey for that. How do you move the mouse, autohotkey as well? any api I have tried to use has been unsuccessful for me.

I have a bunch of stuff in an always running autohotkey, the only one that I use often is "_" mapped to Shift+space. I literally use this many times per minute.

apart from that I have a vortex pok3r keyboard, which I have done my best to map some basic vim keys to. Now I have hjkl a i o d y p everywhere! It's far from perfect, but eases the pain.

Collapse
 
gorvgoyl profile image
Gourav

my win key is adjacent to left ctrl key so after mapping it becomes super convenient to do ctrl+click (and drag). I still needed my win key so I've mapped it to right ctrl. I still use trackpad for mouse movements but with some gestures like 2 fingers tap for right click and 3 finger swipe to swap b/w apps like macbook.

mapping "_" to the shift space is a nice hack.

Collapse
 
madyanalj profile image
Madyan

I try using the Command Palette as much as possible to avoid using my mouse. Configuring these shortcuts will defo help me reduce my mouse usage. Thanks for the great tips dude!

Collapse
 
waylonwalker profile image
Waylon Walker

You're welcome. Getting in and out of the terminal is the #1 greatest hotkey for me. It's also the one that took me the longest to figure out. If it wasn't for that hotkey I would be using tmux and vim, it would have been a hard stop on vscode.

Thanks for the follow ♥'s and all the comments today!

Collapse
 
kiritchoukc profile image
KiritchoukC

Thanks for sharing !

Collapse
 
waylonwalker profile image
Waylon Walker

You're welcome, I really enjoyed putting it together

Collapse
 
udiudi profile image
Udi

I love it, thank you!

Collapse
 
waylonwalker profile image
Waylon Walker

😊 Glad you enjoyed it!