Visual Studio Code keyboard shortcuts
VS Code shortcuts keep navigation, editing, search, layout, files, and AI commands within the same working rhythm. This is the set to learn before adding your own keybindings.
VS Code has enough commands to become noisy. Start with navigation and search, then add editing, layout, files, and AI actions in the order your work brings them into view.
Search and replace
Search the current file or workspace, change the query, and move through results.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Find in current file | CtrlF | CmdF | CtrlF |
| Replace in current file | CtrlH | AltCmdF | CtrlH |
| Show project-wide search view | CtrlShiftF | CmdShiftF | CtrlShiftF |
| Replace in files | CtrlShiftH | CmdShiftH | CtrlShiftH |
| Focus the next search result | F4 | F4 | F4 |
| Focus the previous search result | ShiftF4 | ShiftF4 | ShiftF4 |
Editing
Change lines, format code, add cursors, rename symbols, and apply fixes without leaving the editor.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Toggle line comment | Ctrl/ | Cmd/ | Ctrl/ |
| Delete line | CtrlShiftK | CmdShiftK | CtrlShiftK |
| Insert line below without moving the cursor | CtrlEnter | CmdEnter | CtrlEnter |
| Move line downUse Up instead of Down to move the line up. | AltDown | AltDown | AltDown |
| Copy line downLinux adds Ctrl compared with Windows and macOS. | ShiftAltDown | ShiftOptionDown | CtrlShiftAltDown |
| Format document | ShiftAltF | ShiftOptionF | CtrlShiftI |
| Rename symbol | F2 | F2 | F2 |
| Trigger quick fix | Ctrl. | Cmd. | Ctrl. |
| Add selection to next find match (multi-cursor) | CtrlD | CmdD | CtrlD |
| Undo | CtrlZ | CmdZ | CtrlZ |
| Cut | CtrlX | CmdX | CtrlX |
| Copy | CtrlC | CmdC | CtrlC |
| Paste | CtrlV | CmdV | CtrlV |
| Select all | CtrlA | CmdA | CtrlA |
| Trim trailing whitespace | CtrlKCtrlX | CmdKCmdX | CtrlKCtrlX |
| Change the language mode | CtrlKM | CmdKM | CtrlKM |
Editors, panels, and terminal
Split editor groups, focus panels, open the terminal, and move the active editor around the workspace.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Split editor | Ctrl\ | Cmd\ | Ctrl\ |
| Close editor | CtrlF4 | CmdW | CtrlW |
| Reopen closed editor | CtrlShiftT | CmdShiftT | CtrlShiftT |
| Toggle sidebar visibility | CtrlB | CmdB | CtrlB |
| Toggle integrated terminalUses Ctrl even on macOS. | Ctrl` | Ctrl` | Ctrl` |
| Open a new window | CtrlShiftN | CmdShiftN | CtrlShiftN |
| Close the window | AltF4 | CmdShiftW | CtrlShiftW |
| Focus the first editor group | Ctrl1 | Cmd1 | Ctrl1 |
| Focus the second editor group | Ctrl2 | Cmd2 | Ctrl2 |
Files and settings
Open files, change language or settings, save work, and reach the keyboard shortcuts editor.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Save | CtrlS | CmdS | CtrlS |
| Open Settings | Ctrl, | Cmd, | Ctrl, |
| Open Keyboard Shortcuts | CtrlKCtrlS | CmdKCmdS | CtrlKCtrlS |
| Select a color theme | CtrlKCtrlT | CmdKCmdT | CtrlKCtrlT |
| Open a file | CtrlO | CmdO | CtrlO |
Copilot chat and AI
Built-in chat and inline AI actions in current VS Code.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Open Chat view | CtrlAltI | CtrlCmdI | CtrlAltI |
| Open inline chat in the editorThe same binding starts inline chat in the integrated terminal. | CtrlI | CmdI | CtrlI |
Make the useful keys stick
The goal is not to memorise VS Code's entire command palette. Learn the keys that keep you in the file, then add the ones that remove your most common trip to a panel or menu.
You do not need this whole page in your head. Pick two shortcuts that remove a repeated hand movement, use them until they feel ordinary, and come back for the next pair.