DEV Community

Cover image for What are your favorite VS Code shortcuts?

Posted on

What are your favorite VS Code shortcuts?

Some of my favorite VS Code shortcuts would be:

Open integrated terminal: Ctrl+`
Toggle comments: Ctrl+/
Quick Open, Go to File: Ctrl+P
Show Command palette: Ctrl+Shift+P or F1
Multiple cursors: Alt+Click

What are your favorites?
Find all the shortcuts here: Windows or MacOS.

Discussion (17)

jwp profile image
John Peters • Edited

Ctrl+Shift+K Every day!

Delete Line Ctrl+Shift+K editor.action.deleteLines

Other favorites

Add Line Comment Ctrl+K Ctrl+C editor.action.addCommentLine
Remove Line Comment Ctrl+K Ctrl+U editor.action.removeCommentLine
Undo Ctrl+Z undo
Redo Ctrl+Y redo
Find Ctrl+F actions.find
Go Back Alt+Left workbench.action.navigateBack
Go Forward Alt+Right workbench.action.navigateForward


Show All Symbols Ctrl+T workbench.action.showAllSymbols
Toggle Zen Mode Ctrl+K Z workbench.action.toggleZenMode
Toggle Sidebar Visibility Ctrl+B workbench.action.toggleSidebarVisibility
Toggle Integrated Terminal Ctrl+` workbench.action.terminal.toggleTerminal
Focus Next Search Result F4 search.action.focusNextSearchResult

robertotonino profile image
Roberto Tonino • Edited

I recently discovered the "fold" and "unfold" commands that allow you to open/close groups of parenthesis. Before I had to go next to the line numbers and toggle the groups with the mouse.

Command IDs:


I bound them with CTRL + SHIFT + ' (for fold) and CTRL + SHIFT + Γ¬ (for unfold)

benjioe profile image

I made thats extension if you are interested.

hanpari profile image
Pavel Morava

Good one.
But since I avoid to use my mouse, icons have not such an appeal to me.

robertotonino profile image
Roberto Tonino • Edited

Those bottom left buttons definitely need a keybinding 😁

madza profile image
Madza Author

Looks interesting 🀩

itsjzt profile image
Saurabh Sharma

Alt+shift+i it adds a cursor on every selected line.

madza profile image
Madza Author

Good one, as well πŸ‘

ablil profile image
ablil • Edited

Ctrl + K + U : close all saved files
Ctrl + K + W : close all file
Ctrl + K + [: fold everyting inside the current element
Ctrl + K + ] : unfold everything inside the current element
Ctrl + Shit + F10: peek definition (or maybe css) and do changes on the fly

scroung720 profile image
scroung720 • Edited

The answers of this post are pure gold.

My two cents:
Focus editor - CTRL + 1
Split terminal - CTRL + SHIFT + 5
Zen mode - CTRL + k z
Explore files - CTRL + SHIFT + E
Toggle left sidebar - CTRL + B
Find identifier references: F12

jozalex profile image
Alex Jose

Ctrl+G : line number search
This helps me lot while debugging

hanpari profile image
Pavel Morava • Edited

Find and show symbols in the active file
Ctrl + Shift + O

Similarly works Breadcrumbs
Ctrl + Shift + .

Expand or shrink selection in a closed block of code.
Alt + Shift + Left or Right Arrow

Select all occurences of the word under cursor
Ctrl + Shift + L

joelbonetr profile image

I just installed a plugin to get the same key bindings than jetbrains IDEs πŸ˜†

oguimbal profile image
Olivier Guimbal

The ones I described here 😏

moshe profile image
Moshe Zada

Cmd+Tab for switching back to WebStrom

aakriti_sharma profile image
Aakriti Sharma

For basic HTML template !+Enter is my favorite