Best VS Code shortcuts I frequently use
3 min readDec 23, 2020
Move line up/down
windows - alt + up/down
mac - option + up/down
Add cursor above/below
windows - ctrl + alt + up/down
mac - cmd + option
Duplicate line up/down
windows - shift + alt + up/down
mac - shift + option + up/down
Delete a line
windows - ctrl + X
mac - cmd + X
Select keywords in the next occurrence
windows - ctrl + D
mac - cmd + D
Select all occurrences
ctrl + F2
cmd + F2
Reopen closed file
windows - ctrl + shift + T
mac - cmd + shift + T
Select current line
windows - ctrl + L
mac - cmd + L
Join lines
mac - ctrl + Jin windows this shortcut toggles the terminal panel view
Rename a symbol
windows - F2
mac - F2
Code folding
to fold
windows - ctrl + alt + [
mac - cmd + option + [to unfold
windows - ctrl + alt + ]
mac - cmd + option + ]
Show keyboard shortcuts
Some shortcuts above don’t work? You can check it yourself by opening the command palette by pressing:
windows - ctrl + shift + P
mac - cmd + shift + P
And type Open Keyboard Shortcuts
to see all the keybindings you have in it. Or just press:
windows - ctrl + K, ctrl + S
mac - cmd + K, cmd + S
Customize your keybindings
After you see the keyboard shortcuts tab, you can search for any available command to bind.
Or you can use Record Keys to see if your custom shortcut is available or has been taken for another command.