VS Code Keyboard Shortcuts for Windows and Mac

VS Code keyboard shortcuts improve coding efficiency by reducing reliance on manual mouse movements. This reference page covers 64 verified shortcuts for Windows 10, Windows 11, and macOS Sonoma, including terminal commands and multi-cursor editing. Use these Visual Studio Code hotkeys to streamline your development workflow across various programming languages and environments.

Basic VS Code Keyboard Shortcuts for Editing

General editing commands form the foundation of any coding project. These VS Code hotkeys handle file operations, line manipulations, and basic text editing. Use the tables below to identify the correct VS Code shortcut keys list for your specific operating system.

Windows and Linux Basic Shortcuts

Shortcut / Key CombinationAction / FunctionNotes
Ctrl+Shift+POpen Command PaletteAccess all available commands
Ctrl+PQuick OpenSearch and open files by name
Ctrl+Shift+NNew WindowOpen a new VS Code instance
Ctrl+Shift+WClose WindowExit the current VS Code instance
Ctrl+,User SettingsOpen the settings editor
Ctrl+K Ctrl+SKeyboard ShortcutsOpen the keyboard shortcut editor
Ctrl+XCut lineCuts the entire line if no text is selected
Ctrl+CCopy lineCopies the entire line if no text is selected
Alt+Arrow UpMove line upShifts the current line upward
Alt+Arrow DownMove line downShifts the current line downward
Shift+Alt+Arrow UpCopy line upDuplicates the current line above
Shift+Alt+Arrow DownCopy line downDuplicates the current line below
Ctrl+Shift+KDelete lineRemoves the current line entirely
Ctrl+EnterInsert line belowCreates a new line without breaking the current line
Ctrl+Shift+EnterInsert line aboveCreates a new line before the current line

macOS Basic Shortcuts

Shortcut / Key CombinationAction / FunctionNotes
Command+Shift+POpen Command PaletteAccess all available commands
Command+PQuick OpenSearch and open files by name
Command+,User SettingsOpen the settings editor
Command+Shift+NNew WindowOpen a new VS Code instance
Command+Shift+WClose WindowExit the current VS Code instance
Command+XCut lineCuts the line if selection is empty
Command+CCopy lineCopies the line if selection is empty
Option+Arrow UpMove line upShifts the current line upward
Option+Arrow DownMove line downShifts the current line downward
Shift+Option+Arrow UpCopy line upDuplicates the current line above
Shift+Option+Arrow DownCopy line downDuplicates the current line below
Command+Shift+KDelete lineRemoves the current line entirely
Command+EnterInsert line belowCreates a new line below current cursor

How to Navigate Code in VS Code

Efficient navigation allows developers to jump between files and symbols without scrolling. Use these VS Code keyboard commands to manage your workspace and find specific blocks of code. Mastering these best VS Code shortcuts for beginners prevents time loss during large project reviews.

Navigation Shortcuts for Windows and Linux

Shortcut / Key CombinationAction / FunctionNotes
Ctrl+TShow all SymbolsSearch for symbols across the project
Ctrl+GGo to LineJump to a specific line number
Ctrl+Shift+OGo to SymbolSearch for symbols within the current file
Ctrl+Shift+MShow Problems panelOpen the errors and warnings list
F8Go to next errorCycle through code errors
Shift+F8Go to previous errorCycle backward through code errors
Ctrl+Shift+TabNavigate editor historySwitch between recently opened files
Alt+Arrow LeftGo backReturn to the previous cursor position
Alt+Arrow RightGo forwardMove to the next cursor position

Navigation Shortcuts for macOS

Shortcut / Key CombinationAction / FunctionNotes
Command+TShow all SymbolsSearch symbols in the workspace
Control+GGo to LineJump to a specific line number
Command+Shift+OGo to SymbolSearch symbols in the active file
Command+Shift+MShow Problems panelView the error and warning list
F8Go to next errorJump to the next code warning
Shift+F8Go to previous errorJump to the previous code warning
Control+Shift+TabNavigate editor historyCycle through recently used files
Control+HyphenGo backReturn to the last cursor location
Control+Shift+HyphenGo forwardMove forward in cursor history

Advanced Multi-Cursor and Selection Shortcuts

Multi-cursor editing enables the simultaneous modification of multiple lines. This feature is a significant VS Code keybinds advantage for refactoring code or editing repetitive data structures. If you are working on Python development in VS Code, these commands help manage list items or dictionary keys quickly.

Shortcut / Key CombinationAction / FunctionPlatform
Alt+ClickInsert cursorWindows / Linux
Command+ClickInsert cursormacOS
Ctrl+Alt+Arrow UpInsert cursor aboveWindows / Linux
Command+Option+Arrow UpInsert cursor abovemacOS
Ctrl+Alt+Arrow DownInsert cursor downWindows / Linux
Command+Option+Arrow DownInsert cursor downmacOS
Ctrl+UUndo last cursor operationWindows / Linux
Command+UUndo last cursor operationmacOS
Shift+Alt+IInsert cursor at end of linesWindows / Linux
Shift+Option+IInsert cursor at end of linesmacOS
Ctrl+DAdd selection to next find matchWindows / Linux
Command+DAdd selection to next find matchmacOS
Ctrl+Shift+LSelect all occurrences of matchWindows / Linux
Command+Shift+LSelect all occurrences of matchmacOS

VS Code Terminal and UI Management

Managing the integrated terminal and sidebar panels is 14 shortcuts. These VS Code hotkeys allow you to toggle UI elements to maximize screen space for code. For developers using Git commands for developers, the terminal shortcuts are vital for executing version control tasks without switching windows.

Shortcut / Key CombinationAction / FunctionWindows/LinuxmacOS
Ctrl+`Toggle TerminalCtrl+`Control+`
Ctrl+Shift+`Create new terminalCtrl+Shift+`Control+Shift+`
Ctrl+BToggle Sidebar visibilityCtrl+BCommand+B
Ctrl+Shift+EShow ExplorerCtrl+Shift+ECommand+Shift+E
Ctrl+Shift+FShow SearchCtrl+Shift+FCommand+Shift+F
Ctrl+Shift+GShow Source ControlCtrl+Shift+GControl+Shift+G
Ctrl+Shift+DShow DebugCtrl+Shift+DCommand+Shift+D
Ctrl+Shift+XShow ExtensionsCtrl+Shift+XCommand+Shift+X
Ctrl+Shift+UShow Output panelCtrl+Shift+UCommand+Shift+U
Ctrl+Shift+VOpen Markdown previewCtrl+Shift+VCommand+Shift+V
Ctrl+K ZZen ModeCtrl+K ZCommand+K Z

Frequently Asked Questions

What is the shortcut to format code in VS Code?

Press Shift+Alt+F on Windows or Linux to format the active document. On macOS, press Shift+Option+F to trigger the code formatter for your specific programming language.

How do I open the terminal in VS Code using the keyboard?

Toggle the integrated terminal by pressing Ctrl+ on Windows or Control+ on macOS. Create an additional terminal instance by pressing Ctrl+Shift+ or Control+Shift+.

What is the VS Code shortcut for commenting out code?

Press Ctrl+/ on Windows or Linux to toggle a line comment for the selected text. On macOS, press Command+/ to comment or uncomment the active lines of code.

How do I search for a file in VS Code?

Open the Quick Open search bar by pressing Ctrl+P on Windows or Command+P on macOS. Type the name of the file to see a list of matches and press Enter to open the selection.

How do I change keyboard shortcuts in VS Code?

Access the Keyboard Shortcuts editor by pressing Ctrl+K Ctrl+S on Windows or Command+K Command+S on macOS. This interface allows you to search for commands and assign custom key combinations to any action.

To further improve your speed, check our Windows terminal shortcuts guide to master command line navigation.