Visual Studio Code (Mac) keyboard shortcuts

Visual Studio Code (Mac)
↑   Shift + ⌘ Cmd + P then F1

F1 Show Command Palette

⌘ Cmd + P

Quick Open, Go to File

↑   Shift + ⌘ Cmd + N

New window/instance

⌘ Cmd + W

Close window/instance

⌘ Cmd + ,

User Settings

⌘ Cmd + K then ⌘ Cmd + S

Keyboard Shortcuts

⌘ Cmd + X

Cut line (empty selection)

⌘ Cmd + C

Copy line (empty selection)

⌥ Option + ↑  ↓

Move line up/down

↑   Shift + ⌥ Option + ↑  ↓

Copy line up / down

⌘ Cmd + ⤶ Enter

Insert line below

↑   Shift + ⌘ Cmd + ⤶ Enter

Insert line above

↑   Shift + ⌘ Cmd + \

Jump to matching bracket

⌘ Cmd + ]

Indent/outdent line

or ⌘ Cmd + [
Home

Go to beginning of line

End

Go to end of line

⌘ Cmd +

Go to beginning of file

⌘ Cmd +

Go to end of file

Ctrl + ↑  ↓

Scroll line up/down

Control + Page Up

Scroll page up

Control + Page Down

Scroll page down

⌥ Option + ⌘ Cmd + [

Fold (collapse) region

⌥ Option + ⌘ Cmd + ]

Unfold (uncollapse) region

⌘ Cmd + K then ⌘ Cmd + [

Fold (collapse) all subregions

⌘ Cmd + K then ⌘ Cmd + ]

Unfold (uncollapse) all subregions

⌘ Cmd + K then ⌘ Cmd + 0

Fold (collapse) all regions

⌘ Cmd + K then ⌘ Cmd + J

Unfold (uncollapse) all regions

⌘ Cmd + K then ⌘ Cmd + C

Add line comment

⌘ Cmd + K then ⌘ Cmd + U

Remove line comment

⌘ Cmd + /

Toggle line comment

↑   Shift + ⌥ Option + A

Toggle block comment

⌥ Option + Z

Toggle word wrap

Advertisement
⌘ Cmd + T

Show all symbols

Control + G

Go to line

⌘ Cmd + P

Go to file

↑   Shift + ⌘ Cmd + O

Go to symbol

↑   Shift + ⌘ Cmd + M

Show Problems panel

F8

Go to next error or warning

↑   Shift + F8

Go to previous error or warning

Ctrl + ↑   Shift + ⭾ Tab

Navigate editor group history

Ctrl + -

Go back

Ctrl + ↑   Shift + -

Go forward

Ctrl + ↑   Shift + M

Toggle Tab moves focus

Advertisement
⌘ Cmd + F

Find

⌥ Option + ⌘ Cmd + F

Replace

⌘ Cmd + G

Find next

↑   Shift + ⌘ Cmd + G

Find previous

⌥ Option + ⤶ Enter

Select all occurences of Find match

⌘ Cmd + D

Add selection to next Find match

⌘ Cmd + K then ⌘ Cmd + D

Move last selection to next Find match

⌥ Option + Mouse left click

Insert cursor

⌥ Option + ⌘ Cmd + ↑  ↓

Insert cursor above / below

⌘ Cmd + U

Undo last cursor operation

↑   Shift + ⌥ Option + I

Insert cursor at end of each line selected

⌘ Cmd + I

Select current line

↑   Shift + ⌘ Cmd + L

Select all occurrences of current selection

⌘ Cmd + F2

Select all occurrences of current word

Ctrl + ↑   Shift + ⌘ Cmd +

Expand selection

Ctrl + ↑   Shift + ⌘ Cmd +

Shrink selection

↑   Shift + ⌥ Option + Mouse movement

Column (box) selection

↑   Shift + ⌥ Option + ⌘ Cmd + ←  →

Column (box) selection left/right

Shift + Option + Command + Page Up

Column (box) selection page up

Shift + Option + Command + Page Down

Column (box) selection page down

Ctrl + Space

Trigger suggestion

↑   Shift + ⌘ Cmd + Space

Trigger parameter hints

↑   Shift + ⌥ Option + F

Format document

⌘ Cmd + K then ⌘ Cmd + F

Format selection

F12

Go to Definition

⌥ Option + F12

Peek Definition

⌘ Cmd + K then F12

12 Open Definition to the side

⌘ Cmd + .

Quick Fix

↑   Shift + F12

Show References

F2

Rename Symbol

⌘ Cmd + K then ⌘ Cmd + X

Trim trailing whitespace

⌘ Cmd + K then M

M Change file language

Advertisement
⌘ Cmd + W

Close editor

⌘ Cmd + K then F

F Close folder

⌘ Cmd + \

Split editor

⌘ Cmd + 1

Focus into first group

⌘ Cmd + 2

Focus into second group

⌘ Cmd + 3

Focus into third group

⌘ Cmd + K then ⌘ Cmd + ←  →

Focus into previous/next editor group

⌘ Cmd + K then ↑   Shift + ⌘ Cmd +

Move editor left

⌘ Cmd + K then ↑   Shift + ⌘ Cmd +

Move editor right

⌘ Cmd + K then ←  →

ht Move active editor group

⌘ Cmd + N

New File

⌘ Cmd + O

Open File

⌘ Cmd + S

Save

↑   Shift + ⌘ Cmd + S

Save As

⌥ Option + ⌘ Cmd + S

Save All

⌘ Cmd + W

Close

⌘ Cmd + K then ⌘ Cmd + W

Close All

Ctrl + ↑   Shift + T

Reopen closed editor

⌘ Cmd + K then ⤶ Enter

er Keep preview mode editor open

Control + ⭾ Tab

Open next

Control + ↑   Shift + ⭾ Tab

Open previous

⌘ Cmd + K then P

P Copy path of active file

⌘ Cmd + K then R

R Reveal active file in Explorer

⌘ Cmd + K then O

O Show active file in new window/instance

Control + ⌘ Cmd + F

Toggle full screen

⌥ Option + ⌘ Cmd + 1

Toggle editor layout (horizontal/vertical)

⌘ Cmd + =

Zoom in

↑   Shift + ⌘ Cmd + -

Zoom out

⌘ Cmd + B

Toggle Sidebar visibility

↑   Shift + ⌘ Cmd + E

Show Explorer / Toggle focus

↑   Shift + ⌘ Cmd + F

Show Search

Control + ↑   Shift + G

Show Source Control

↑   Shift + ⌘ Cmd + D

Show Debug

↑   Shift + ⌘ Cmd + X

Show Extensions

↑   Shift + ⌘ Cmd + H

Replace in files

↑   Shift + ⌘ Cmd + J

Toggle Search details

↑   Shift + ⌘ Cmd + U

Show Output panel

↑   Shift + ⌘ Cmd + V

Open Markdown preview

⌘ Cmd + K then V

V Open Markdown preview to the side

⌘ Cmd + K then Z

Z Zen Mode (Esc Esc to exit)

F9

Toggle breakpoint

F5

Start/Continue

↑   Shift + F5

Stop

F11

Step into

↑   Shift + F11

Step out

F10

Step over

⌘ Cmd + K then ⌘ Cmd + I

Show hover

Advertisement
Control + `

Show integrated terminal

Control + ↑   Shift + `

Create new terminal

⌘ Cmd + C

Copy selection

⌘ Cmd + ↑  ↓

Scroll up/down

Page Up

Scroll page up

Page Down

Scroll page down

⌘ Cmd + Home

Scroll to top

⌘ Cmd + End

Scroll to bottom


Share this page on:

Program information

Program name: Visual Studio Code (Mac) (Developer tools)

Visual Studio Code is a source code editor developed by Microsoft for Windows, Linux and macOS. It has features such as debugging, Git control, syntax highlighting, smart code completion, snippets and refactoring. It's free and open-source, however official download is under a proprietary license.

Web page: https://code.visualstudio.com


Similar programs



Advertisement

Advertisement

  Subscribe to our mailing list!

Useful technology tips and keyboard shortcuts will appear in your inbox.

Your email is kept private and we don't spam.

What is your favorite Visual Studio Code (Mac) hotkey? Do you have any useful tips for program? Let other users know below.