0% found this document useful (0 votes)
527 views

VS Code Keyboard Shortcuts

The document provides keyboard shortcuts for Visual Studio Code across Windows and macOS. It includes shortcuts for general editing, navigation, and display. The shortcuts are organized into categories and displayed side-by-side for easy reference across operating systems.

Uploaded by

David Ariza
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
527 views

VS Code Keyboard Shortcuts

The document provides keyboard shortcuts for Visual Studio Code across Windows and macOS. It includes shortcuts for general editing, navigation, and display. The shortcuts are organized into categories and displayed side-by-side for easy reference across operating systems.

Uploaded by

David Ariza
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Visual Studio Code

Keyboard Shortcuts

By Estefania Cassingena Navone

EstefaniaCN Visual Studio Code for Developers: Beginner to Advanced


Welcome! I’m Estefania, your course instructor. It’s great to have you in the course.

In this guide, you will find the most frequently-used keyboard shortcuts in Visual Studio
Code. They can be incredibly helpful for becoming a more productive developer and for
getting things done much faster.

My suggestion would be to print this guide and keep it close to you as a helpful resource
that you can refer to during the course and even beyond, as you start working on your
personal and professional projects with Visual Studio Code.

This resource is based on the official keyboard shortcuts provided by Visual Studio Code in
the following guides:

Windows: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf
macOS: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf

For your convenience, I reorganized the categories and reformatted the presentation, to
display the keyboard shortcuts side-by-side for both Windows and macOS. This format,
inspired by my own experience working with these keyboard shortcuts, makes it easier to
navigate and master them across operating systems.

Please note that these keyboard shortcuts are designed for English-layout keyboards and
English operating systems. They might be different for other languages. So, before you
dive in, make sure your keyboard and operating system are set to English to follow this
guide.

(a) Please note that the letters in the keyboard shortcuts are written in uppercase. I is
uppercase i and L is uppercase l. In practice, they will work in both lowercase or uppercase.

(b) For macOS users, in this guide Cmd is , Option is , and Control is .

This resource is intended to be downloaded and used by students enrolled in my online


course “Visual Studio Code for Developers: Beginner to Advanced”.

Copyright © Estefania Cassingena Navone. All rights reserved.

EstefaniaCN
Estefania Cassingena Navone
Course Instructor
Visual Studio Code
Keyboard Shortcuts

General and Basic Editing


Action Windows macOS

Show Command Palette Ctrl + Shift + P, F1 Shift + Cmd + P, F1

Quick Open / Go to File... Ctrl + P Cmd + P

New Window/instance Ctrl + Shift + N Shift + Cmd + N

Close Window/instance Ctrl + Shift + W Cmd + W

User Settings Ctrl + , Cmd + ,

Keyboard Shortcuts Ctrl+K Ctrl+S Cmd+K Cmd+S

Cut line (empty selection) Ctrl + X Cmd + X

Copy line (empty selection) Ctrl + C Cmd + C

Move line up Alt + Up Arrow Option + Up Arrow

Move line down Alt + Down Arrow Option + Down Arrow

Copy line up Shift + Alt + Up Arrow Shift + Option + Up Arrow

Copy line down Shift + Alt + Down Arrow Shift + Option + Down Arrow

Delete line Ctrl + Shift + K Shift + Cmd + K

Insert line below Ctrl + Enter Cmd + Enter

EstefaniaCN Visual Studio Code for Developers: Beginner to Advanced 1


Visual Studio Code
Keyboard Shortcuts

General and Basic Editing


Action Windows macOS

Insert line above Ctrl + Shift + Enter Shift + Cmd + Enter

Jump to matching bracket Ctrl + Shift + \ Shift + Cmd + \

Indent line Ctrl + ] Cmd + ]

Outdent line Ctrl + [ Cmd + [

Go to beginning of line Home Home

Go to end of line End End

Go to beginning of file Ctrl + Home Cmd + Up Arrow

Go to end of file Ctrl + End Cmd + Down Arrow

Scroll line up Ctrl + Up Arrow Control + PgUp

Scroll line down Ctrl + Down Arrow Control + PgDn

Scroll page up Alt + PgUp Cmd + PgUp

Scroll page down Alt + PgDn Cmd + PgDn

Fold (collapse) region Ctrl + Shift + [ Option + Cmd + [

Unfold (uncollapse) region Ctrl + Shift + ] Option + Cmd + ]

Fold (collapse) all subregions Ctrl+K Ctrl+[ Cmd+K Cmd+[

Unfold (uncollapse) all subregions Ctrl+K Ctrl+] Cmd+K Cmd+]

EstefaniaCN Visual Studio Code for Developers: Beginner to Advanced 2


Visual Studio Code
Keyboard Shortcuts

General and Basic Editing


Action Windows macOS

Fold (collapse) all regions Ctrl+K Ctrl+0 Cmd+K Cmd+0

Unfold (uncollapse) all regions Ctrl+K Ctrl+J Cmd+K Cmd+J

Add line comment Ctrl+K Ctrl+C Cmd+K Cmd+C

Remove line comment Ctrl+K Ctrl+U Cmd+K Cmd+U

Toggle line comment Ctrl + / Cmd + /

Toggle block comment Shift + Alt + A Shift + Option + A

Toggle word wrap Alt + Z Option + Z

Navigation

Action Windows macOS

Show all symbols Ctrl + T Cmd + T

Go to line... Ctrl + G Control + G

Go to file... Ctrl + P Cmd + P

Go to symbol... Ctrl + Shift + O Shift + Cmd + O

EstefaniaCN Visual Studio Code for Developers: Beginner to Advanced 3


Visual Studio Code
Keyboard Shortcuts

Navigation
Action Windows macOS

Show problems panel Ctrl + Shift + M Shift + Cmd + M

Go to next error or warning F8 F8

Go to previous error or warning Shift + F8 Shift + F8

Navigate editor group history Ctrl + Shift + Tab Control + Shift + Tab

Go back Alt + Left Arrow Control + -

Go forward Alt + Right Arrow Control + Shift + -

Toggle Tab moves focus Ctrl + M Control + Shift + M

Display
Action Windows macOS

Toggle Full Screen F11 Control + Cmd + F

Toggle Editor Layout (horizontal/vertical) Shift + Alt + 0 Option + Cmd + 0

Zoom in Ctrl + = Cmd + =

Zoom out Ctrl + - Shift + Cmd + -

Toggle Sidebar visibility Ctrl + B Cmd + B

EstefaniaCN Visual Studio Code for Developers: Beginner to Advanced 4


Visual Studio Code
Keyboard Shortcuts

Display
Action Windows macOS

Show Explorer / Toggle Focus Ctrl + Shift + E Shift + Cmd + E

Show Search Ctrl + Shift + F Shift + Cmd + F

Show Source Control Ctrl + Shift + G Control + Shift + G

Show Debug Ctrl + Shift + D Shift + Cmd + D

Show Extensions Ctrl + Shift + X Shift + Cmd + X

Replace in files Ctrl + Shift + H Shift + Cmd + H

Toggle search details Ctrl + Shift + J Shift + Cmd + J

Show output panel Ctrl + Shift + U Shift + Cmd + U

Open Markdown preview Ctrl + Shift + V Shift + Cmd + V

Open Markdown preview to the side Ctrl+K V Cmd+K V

Zen Mode Ctrl+K Z Cmd+K Z

Exit Zen Mode Esc Esc Esc Esc

EstefaniaCN Visual Studio Code for Developers: Beginner to Advanced 5


Visual Studio Code
Keyboard Shortcuts

File Management
Action Windows macOS

New File Ctrl + N Cmd + N

Open File... Ctrl + O Cmd + O

Save Ctrl + S Cmd + S

Save As... Ctrl + Shift + S Shift + Cmd + S

Save All Ctrl+K S Option + Cmd + S

Close Ctrl + F4 Cmd + W

Close All Ctrl+K Ctrl+W Cmd+K Cmd+W

Reopen closed editor Ctrl + Shift + T Shift + Cmd + T

Keep preview mode editor open Ctrl+K Enter Cmd+K Enter

Open next Ctrl + Tab Control + Tab

Open previous Ctrl + Shift + Tab Control + Shift + Tab

Copy path of active file Ctrl+K P Cmd+K P

Reveal active file in Explorer/Finder Ctrl+K R Cmd+K R

Show active file in new window/instance Ctrl+K O Cmd+K O

EstefaniaCN Visual Studio Code for Developers: Beginner to Advanced 6


Visual Studio Code
Keyboard Shortcuts

Editor Management
Action Windows macOS

Close editor Ctrl+F4, Ctrl+W Cmd + W

Close folder Ctrl+K F Cmd+K F

Split editor Ctrl + \ Cmd + \

Focus into first editor group Ctrl + 1 Cmd + 1

Focus into second editor group Ctrl + 2 Cmd + 2

Focus into third editor group Ctrl + 3 Cmd + 3

Cmd+K
Focus into previous editor group Ctrl+K Ctrl+Left Arrow
Cmd+Left Arrow

Cmd+K
Focus into next editor group Ctrl+K Ctrl+Right Arrow
Cmd+Right Arrow

Cmd+K
Move editor left Ctrl + Shift + PgUp
Shift+Cmd+Left Arrow

Cmd+K
Move editor right Ctrl + Shift + PgDn Shift+Cmd+Right Arrow

Move active editor group (left) Ctrl+K Left Arrow Cmd+K Left Arrow

Move active editor group (right) Ctrl+K Right Arrow Cmd+K Right Arrow

EstefaniaCN Visual Studio Code for Developers: Beginner to Advanced 7


Visual Studio Code
Keyboard Shortcuts

Integrated Terminal
Action Windows macOS

Show integrated terminal Ctrl + ` (backtick) Control + ` (backtick)

Create new terminal Ctrl + Shift + ` Control + Shift + `

Copy selection Ctrl + C Cmd + C

Paste into active terminal Ctrl + V Cmd + V

Scroll up Ctrl + Up Arrow Cmd + Up Arrow

Scroll down Ctrl + Down Arrow Cmd + Down Arrow

Scroll page up Shift + PgUp PgUp

Scroll page down Shift + PgDn PgDn

Scroll to top Ctrl + Home Cmd + Home

Scroll to bottom Ctrl + End Cmd + End

EstefaniaCN Visual Studio Code for Developers: Beginner to Advanced 8


Visual Studio Code
Keyboard Shortcuts

Rich Language Editing


Action Windows macOS

Control+Space,
Trigger suggestion Ctrl+Space, Ctrl+I
Cmd+I

Trigger parameter hints Ctrl + Shift + Space Shift + Cmd + Space

Format document Shift + Alt + F Shift + Option + F

Format selection Ctrl+K Ctrl+F Cmd+K Cmd+F

Go to definition F12 F12

Peek definition Alt + F12 Option + F12

Open definition to the side Ctrl+K F12 Cmd+K F12

Quick fix Ctrl + . Cmd + .

Show references Shift + F12 Shift + F12

Rename symbol F2 F2

Trim trailing whitespace Ctrl+K Ctrl+X Cmd+K Cmd+X

Change file language Ctrl+K M Cmd+K M

EstefaniaCN Visual Studio Code for Developers: Beginner to Advanced 9


Visual Studio Code
Keyboard Shortcuts

Search and Replace


Action Windows macOS

Find Ctrl + F Cmd + F

Replace Ctrl + H Option + Cmd + F

Find Next F3 Cmd + G

Find Previous Shift + F3 Shift + Cmd + G

Select all occurrences of Find match Alt + Enter Option + Enter

Add selection to next Find match Ctrl + D Cmd + D

Move last selection to next Find match Ctrl+K Ctrl+D Cmd+K Cmd+D

Toggle case-sensitive Alt + C Option + Cmd + C

Toggle regex Alt + R Option + Cmd + R

Toggle whole word Alt + W Option + Cmd + W

EstefaniaCN Visual Studio Code for Developers: Beginner to Advanced 10


Visual Studio Code
Keyboard Shortcuts

Selection and Multi-Cursor


Action Windows macOS

Insert cursor Alt + Click Option + Click

Option + Cmd
Insert cursor above Ctrl + Alt + Up Arrow
+ Up Arrow

Option + Cmd
Insert cursor below Ctrl + Alt + Down Arrow
+ Down Arrow

Undo last cursor operation Ctrl + U Cmd + U

Insert cursor at end of each line selected Shift + Alt + I Shift + Option + I

Select current line Ctrl + L Cmd + L

Select all occurrences of current selection Ctrl + Shift + L Shift + Cmd + L

Select all occurrences of current word Ctrl + F2 Cmd + F2

Control + Shift + Cmd


Expand selection Shift + Alt + Right Arrow
+ Right Arrow

Control + Shift + Cmd


Shrink selection Shift + Alt + Left Arrow
+ Left Arrow

Shift + Option
Column (box) selection Shift + Alt + Drag Mouse
+ Drag Mouse

Ctrl + Shift + Alt Shift + Option + Cmd


Column (box) selection up
+ Up Arrow + Up Arrow

Ctrl + Shift + Alt Shift + Option + Cmd


Column (box) selection down
+ Down Arrow + Down Arrow

EstefaniaCN Visual Studio Code for Developers: Beginner to Advanced 11


Visual Studio Code
Keyboard Shortcuts

Selection and Multi-Cursor


Action Windows macOS

Ctrl + Shift + Alt Shift + Option + Cmd


Column (box) selection left
+ Left Arrow + Left Arrow

Ctrl + Shift + Alt Shift + Option + Cmd


Column (box) selection right
+ Right Arrow + Right Arrow

Ctrl + Shift + Alt Shift + Option + Cmd


Column (box) selection page up
+ PgUp + PgUp

Ctrl + Shift + Alt Shift + Option + Cmd


Column (box) selection page down
+ PgDn + PgDn

Debug
Action Windows macOS

Toggle Breakpoint F9 F9

Start / Continue F5 F5

Step into F11 F11

Step out Shift + F11 Shift + F11

Step over F10 F10

Stop Shift + F5 Shift + F5

Show hover Ctrl+K Ctrl+I Cmd+K Cmd+I

EstefaniaCN Visual Studio Code for Developers: Beginner to Advanced 12

You might also like