Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

VSCode Keyboard Shortcuts Reference

VSCode Keyboard Shortcuts Reference

This section is Visual Studio Code (VS Code) a comprehensive list of commonly used shortcuts, covering code editing, file management, debugging, and other operations, to help improve development efficiency.

Shortcut settings can be viewed through Code > Preferences > Keyboard Shortcuts in the menu bar:

Through the Keyboard Shortcuts editor, you can customize keyboard shortcuts to suit your needs and improve development efficiency.

Explanation:

  1. macOS 's Cmd key corresponds to the Windows/Linux Ctrl key.

  2. macOS 's Option key corresponds to the Windows/Linux Alt key.

  3. Some shortcuts may differ depending on the system or configuration.


1. General operation shortcuts

Function Windows/Linux macOS
Open command palette Ctrl + Shift + P Cmd + Shift + P
Open Settings Ctrl + , Cmd + ,
Open the terminal `Ctrl + `` `Ctrl + ``
New window Ctrl + Shift + N Cmd + Shift + N
Close a window Ctrl + Shift + W Cmd + Shift + W
Save file Ctrl + S Cmd + S
Save All Ctrl + K S Cmd + Option + S
Toggle Auto Save Ctrl + Shift + P Search afterwards Auto Save Same as left
Quick Open, Go to File Ctrl + P Cmd + P
Keyboard Shortcuts settings Ctrl + K, Ctrl + S Cmd + K, Cmd + S

2. File and editor operations

Function Windows/Linux macOS
New file Ctrl + N Cmd + N
Opening a File Ctrl + O Cmd + O
Save file Ctrl + S Cmd + S
Save as Ctrl + Shift + S Cmd + Shift + S
Closing a File Ctrl + W Cmd + W
Close All Files Ctrl + K, Ctrl + W Cmd + K, Cmd + W
Reopen Closed File Ctrl + Shift + T Cmd + Shift + T
Open Folder Ctrl+K O Cmd+K O
Previous File Ctrl+Tab Cmd+Tab
Next File Ctrl+Shift+Tab Cmd+Shift+Tab
Toggle Editor Layout Alt+Shift+数字 Cmd+Option+数字
Fullscreen toggle F11 Ctrl+Cmd+F

3. Code editing shortcuts

Function Windows/Linux macOS
Undo Ctrl + Z Cmd + Z
Redo Ctrl + Y Cmd + Y
Copy Ctrl + C Cmd + C
Cut Ctrl + X Cmd + X
Paste Ctrl + V Cmd + V
Find Ctrl + F Cmd + F
Replacement Ctrl + H Cmd + H
Select All Ctrl + A Cmd + A
Format Code Shift + Alt + F Shift + Option + F
Comment Line Ctrl + / Cmd + /
Multi-line comment Shift + Alt + A Shift + Option + A
Copy current line Alt + Shift + Down Option + Shift + Down
Delete current line Ctrl + Shift + K Cmd + Shift + K
Move Current Line Alt + Up/Down Option + Up/Down
Select Current Line Ctrl + L Cmd + L
Find and Replace Ctrl + H Cmd + Option + F
Go to Line Ctrl + G Cmd + G
Insert Line Below Ctrl + Enter Cmd + Enter
Insert Line Above Ctrl + Shift + Enter Cmd + Shift + Enter
Go to Matching Bracket Ctrl + Shift + \ Cmd + Shift + \
Indent/Outdent Ctrl + ] / [ Cmd + ] / [
Go to Line Start/End Home / End Cmd + ← / →
Go to File Start/End Ctrl + Home / End Cmd + ↑ / ↓
Fold/Unfold Region Ctrl + Shift + [ / ] Option + Cmd + [ / ]
Toggle Block Comment Shift + Alt + A Option + Shift + A
Toggle Word Wrap Alt + Z Option + Z

4. Multi-cursor operations

Function Windows/Linux macOS
Insert Cursor Alt + 点击 Option + 点击
Insert Cursor Above/Below Ctrl + Alt + ↑ / ↓ Option + Cmd + ↑ / ↓
Undo Last Cursor Operation Ctrl + U Cmd + U
Select Current Line Ctrl + L Cmd + L
Select All Occurrences Ctrl + F2 Cmd + F2
Column Selection Shift + Alt + 拖动 Shift + Option + 拖动
Select All Matches Ctrl + Shift + L Cmd + Shift + L
Select Next Match Ctrl + D Cmd + D

5. Debug shortcuts

Function Windows/Linux macOS
Start Debugging F5 F5
Stop Debugging Shift+F5 Shift+F5
Step Over F10 F10
Step Into F11 F11
Step Out Shift+F11 Shift+F11
Toggle Breakpoint F9 F9

6. Search and navigation

Function Windows/Linux macOS
Global search Ctrl+Shift+F Cmd+Shift+F
Go to Definition F12 F12
Go to Declaration Ctrl+F12 Cmd+F12
Find usages Shift+F12 Shift+F12
Show Outline Ctrl+Shift+O Cmd+Shift+O
Go Back to Previous Location Ctrl+Alt+Left Cmd+Option+Left
Go Forward to Next Location Ctrl+Alt+Right Cmd+Option+Right

7. Versioning

Function Windows/Linux macOS
Open Source Control View Ctrl+Shift+G Cmd+Shift+G
Commit code Ctrl+Enter Cmd+Enter
View changes Ctrl+Shift+D Cmd+Shift+D

8. Terminal operations

Function Windows/Linux macOS
Show integrated terminal Ctrl + ` Ctrl + `
New terminal `Ctrl+Shift+``` `Cmd+Shift+```
Switch terminal Ctrl+PageUp/PageDown Cmd+PageUp/PageDown
Close terminal Ctrl+Shift+W Cmd+Shift+W

9. Command Palette

Operation Windows/Linux macOS
Open command palette Ctrl + Shift + P Cmd + Shift + P
Open Keyboard Shortcuts Reference Ctrl + K, Ctrl + S Cmd + K, Cmd + S

10. Display

Function Windows/Linux macOS
Toggle Full Screen F11 Cmd + Ctrl + F
Zoom In/Out Ctrl + = / - Cmd + = / -
Toggle Sidebar Visibility Ctrl + B Cmd + B
Show Explorer Ctrl + Shift + E Cmd + Shift + E
Show Search Ctrl + Shift + F Cmd + Shift + F
Show Source Control Ctrl + Shift + G Cmd + Shift + G
Show Debug Ctrl + Shift + D Cmd + Shift + D
Show Extensions Ctrl + Shift + X Cmd + Shift + X

11. Extension operations

Operation Windows/Linux macOS
Install Extension Ctrl + Shift + X Cmd + Shift + X
Extension Management Ctrl + Shift + P → Type "Extensions" Same as left

12. Others

Function Windows/Linux macOS
Open Markdown Preview Ctrl + K, V Cmd + K, V
Zen Mode Ctrl + K, Z Cmd + K, Z

Official keyboard shortcut reference

Windows Platform

macOS Platform

Linux Platform


The above shortcuts can be customized through the keybinding settings . In VS Code, press Ctrl+K Ctrl+S(on macOS, Cmd+K Cmd+S) to open the keybindings page for easy lookup and modification of shortcuts.