Skip to content

Instantly share code, notes, and snippets.

@cleary
Forked from bradtraversy/vscode_shortcuts.md
Last active March 15, 2024 06:35
Show Gist options
  • Star 28 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save cleary/d168e301429c0305c49d97907796c72d to your computer and use it in GitHub Desktop.
Save cleary/d168e301429c0305c49d97907796c72d to your computer and use it in GitHub Desktop.
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

  • For mac, replace "Ctrl" with "cmd" and "Alt" with "option"

Official List of all commands

General & File

Open Command Pallete

Ctrl+Shift+P

Open New Window

Ctrl+Shift+N

Close Window

Ctrl+W

Quick File Open

Ctrl+P

Access Settings

Ctrl+,

New File

Ctrl+N

Open File

Ctrl+O

Save

Ctrl+S
Ctrl+Shift+S # Save As

Close File

Ctrl+F4

Change File Tabs

Ctrl+PageUP
Ctrl+PageDown

Open Next File (Dropdown)

Ctrl+Tab # Scroll next
Ctrl+Shift+Tab # Scroll prev

Zoom

Ctrl++ # Zoom in
Ctrl+- # Zoom out

Toggle Sidebar

Ctrl+B

Toggle Sidebar Focus

Ctrl+Shift+E

Spilt Editor

Ctrl+\

Integrated Terminal

Ctrl+` # Toggle terminal
Ctrl+Shift+` # Create new terminal

Code Editing

Go To Start & End Of Line

home
end

Go To Start & End Of File

Ctrl+Home
Ctrl+End

Cut, Copy & Past Line

Ctrl+X # Cut
Ctrl+C # Copy
Ctrl+V # Paste

Move Line Up & Down

Alt+Up
Alt+Down

Copy Line Up & Down

Shift+Alt+Up
Shift+Alt+Down

Remove Line

Ctrl+Shift+K

Insert Line

Ctrl+Enter # Insert above
Ctrl+Shift+Enter # Insert below

Jump To Matching Bracket

Ctrl+Shift+\

Fold

Ctrl+Shift+[
Ctrl+Shift+]

Fold All

Ctrl+K, Ctrl+0 (zero)
Ctrl+K, Ctrl+J

Add Line Comment

Ctrl+/

Add Block Comment

Shift+Alt+A

Scroll Up & Down

Ctrl+Up
Ctrl+Down

Move By Word

Ctrl+Right
Ctrl+Left

Highlight Code

Shift+Any Direction

Go To Next Match

F3

Select Next Match

Ctrl+D

Select All Matches & Add Cursor

Ctrl+F2

Select All Matches from Find

Alt+Enter

Add Cursor

Alt+Click

Go to Symbol

Ctrl+Shift+O
@Ahmed-Wasl
Copy link

I really found it helpful, and if there's more plz tell me.

@osama-ammar
Copy link

Great info

@Rajsingh365
Copy link

Really Helpful

@nathanr2306
Copy link

A really cool one I found today is Ctrl + Shift + L. If you click a variable, then hit that hotkey, it will allow you to change every occurrence of that variable.

@SLroot
Copy link

SLroot commented Apr 19, 2023

really great, anybody have same thing for linux?

@cleary
Copy link
Author

cleary commented Apr 19, 2023

really great, anybody have same thing for linux?

I use linux exclusively, these should all work

Side note for everyone commenting on this, I apologise but I'm not using vscode much at all these days so this is unlikely to be maintained.
If you know of a more current document, please feel free to link it for the benefit of everyone

@fullstackhero1
Copy link

The code formatting is available in Visual Studio Code through the following shortcuts:
On Windows Shift + Alt + F
On Mac Shift + Option + F

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment