Written by Mark Pringle | Last Updated on Wednesday, November 23, 2022
Visual Studio General Information
Popular Visual Studio Code keyboard shortcuts. Keyboard Shortcuts enable you to be more efficient in your work environment. Here you will find general, basic editing, navigation, search and replace, and more Visual Studio Code keyboard shortcuts for windows computers.
See also: Visual Studio keyboard shortcuts.
General
| Commands | Keyboard Shortcuts |
|---|---|
| Show Command Palette | Ctrl+Shift+P, F1 |
| Quick Open, Go to File… | Ctrl+P |
| New window/instance | Ctrl+Shift+N |
| Close window/instance | Ctrl+Shift+W |
| User Settings | Ctrl+, |
| Keyboard Shortcuts | Ctrl+K Ctrl+S |
Basic Editing
| Commands | Keyboard Shortcuts |
|---|---|
| Cut line (empty selection) | Ctrl+X |
| Copy line (empty selection) | Ctrl+C |
| Move line up/down | Alt+ ↑ / ↓ |
| Copy line up/down | Shift+Alt + ↓ / ↑ |
| Delete line | Ctrl+Shift+K |
| Insert line below | Ctrl+Enter |
| Insert line above | Ctrl+Shift+Enter |
| Jump to matching bracket | Ctrl+Shift+\ |
| Indent/outdent line | Ctrl+] / [ |
| Go to beginning/end of line | Home / End |
| Go to beginning of file | Ctrl+Home |
| Go to end of file | Ctrl+End |
| Scroll line up/down | Ctrl+↑ / ↓ |
| Scroll page up/down | Alt+PgUp / PgDn |
| Fold (collapse) region | Ctrl+Shift+[ |
| Unfold (uncollapse) region | Ctrl+Shift+] |
| Fold (collapse) all subregions | Ctrl+K Ctrl+[ |
| Unfold (uncollapse) all subregions | Ctrl+K Ctrl+] |
| Fold (collapse) all regions | Ctrl+K Ctrl+0 |
| Unfold (uncollapse) all regions | Ctrl+K Ctrl+J |
| Add line comment | Ctrl+K Ctrl+C |
| Remove line comment | Ctrl+K Ctrl+U |
| Toggle line comment | Ctrl+/ |
| Toggle block comment | Shift+Alt+A |
| Toggle word wrap | Alt+Z |
Navigation
| Commands | Keyboard Shortcuts |
|---|---|
| Show all Symbols | Ctrl+T |
| Go to Line... | Ctrl+G |
| Go to File... | Ctrl+P |
| Go to Symbol... | Ctrl+Shift+O |
| Show Problems panel | Ctrl+Shift+M |
| Go to next error or warning | F8 |
| Go to previous error or warning | Shift+F8 |
| Navigate editor group history | Ctrl+Shift+Tab |
| Go back / forward | Alt+ ← / → |
| Toggle Tab moves focus | Ctrl+M |
Search and Replace
| Commands | Keyboard Shortcuts |
|---|---|
| Find | Ctrl+F |
| Replace | Ctrl+H |
| Find next/previous | F3 / Shift+F3 |
| Select all occurences of Find match | Alt+Enter |
| Add selection to next Find match | Ctrl+D |
| Move last selection to next Find match | Ctrl+K Ctrl+D |
| Toggle case-sensitive / regex / whole word | Alt+C / R / W |
Multi-cursor and Selection
| Commands | Keyboard Shortcuts |
|---|---|
| Insert cursor | Alt+Click |
| Insert cursor above / below | Ctrl+Alt+ ↑ / ↓ |
| Undo last cursor operation | Ctrl+U |
| Insert cursor at end of each line selected | Shift+Alt+I |
| Select current line | Ctrl+L |
| Select all occurrences of current selection | Ctrl+Shift+L |
| Select all occurrences of current word | Ctrl+F2 |
| Expand selection | Shift+Alt+→ |
| Shrink selection | Shift+Alt+← |
| Column (box) selection | Shift+Alt + (drag mouse) |
| Column (box) selection | Ctrl+Shift+Alt + (arrow key) |
| Column (box) selection page up/down | Ctrl+Shift+Alt +PgUp/PgDn |
Rich Languages Editing
| Commands | Keyboard Shortcuts |
|---|---|
| Trigger suggestion | Ctrl+Space, Ctrl+I |
| Trigger parameter hints | Ctrl+Shift+Space |
| Format document | Shift+Alt+F |
| Format selection | Ctrl+K Ctrl+F |
| Go to Definition | F12 |
| Peek Definition | Alt+F12 |
| Open Definition to the side | Ctrl+K F12 |
| Quick Fix | Ctrl+. |
| Show References | Shift+F12 |
| Rename Symbol | F2 |
| Trim trailing whitespace | Ctrl+K Ctrl+X |
| Change file language | Ctrl+K M |
Editor Management
| Commands | Keyboard Shortcuts |
|---|---|
| Close editor | Ctrl+F4, Ctrl+W |
| Close folder | Ctrl+K F |
| Split editor | Ctrl+\ |
| Focus into 1st, 2nd or 3rd editor group | Ctrl+ 1 / 2 / 3 |
| Move editor left/right | Ctrl+Shift+PgUp / PgDn |
File Management
| Commands | Keyboard Shortcuts |
|---|---|
| New File | Ctrl+N |
| Open File... | Ctrl+O |
| Save | Ctrl+S |
| Save As... | Ctrl+Shift+S |
| Save All | Ctrl+K S |
| Close | Ctrl+F4 |
| Close All | Ctrl+K Ctrl+W |
| Reopen closed editor | Ctrl+Shift+T |
| Keep preview mode editor open | Ctrl+K Enter |
| Open next | Ctrl+Tab |
| Open previous | Ctrl+Shift+Tab |
