Source Control (Git)
| Action | How |
|---|
| Switch branch | Click branch name in bottom-left status bar |
| Open Source Control panel | Cmd + Shift + G |
| Merge branch | Source Control → ... → Branch → Merge Branch |
| Resolve merge conflicts | Open conflicted file → use inline merge editor (Accept Current / Incoming / Both) |
| Push | Source Control → ... → Push, or click sync icon in status bar |
| Stage file | Click + next to file in Source Control panel |
| Discard changes | Right-click file → Discard Changes |
Navigation
| Shortcut | Action |
|---|
Cmd + P | Quick open file by name |
Cmd + Shift + P | Command palette |
Cmd + B | Toggle sidebar |
Cmd + \ | Split editor |
Cmd + W | Close tab |
Ctrl + Tab | Cycle through open tabs |
Cmd + Shift + E | Focus file explorer |
Cmd + Shift + F | Search across files |
Cmd + Shift + H | Replace across files |
Editing
| Shortcut | Action |
|---|
Cmd + D | Select next occurrence of word |
Cmd + Shift + L | Select all occurrences |
Option + Click | Add cursor |
Cmd + Option + ↑/↓ | Add cursor above/below |
Option + ↑/↓ | Move line up/down |
Shift + Option + ↑/↓ | Copy line up/down |
Cmd + Shift + K | Delete line |
Cmd + / | Toggle line comment |
Shift + Option + F | Format document |
F2 | Rename symbol |
F12 | Go to definition |
Opt + F12 | Peek definition |
Shift + F12 | Find all references |
Terminal
| Shortcut | Action |
|---|
Ctrl + ` | Toggle integrated terminal |
Cmd + Shift + ` | New terminal |
Cmd + K | Clear terminal |
Useful Settings
// settings.json snippets
{
"editor.formatOnSave": true,
"editor.tabSize": 2,
"editor.wordWrap": "on",
"editor.minimap.enabled": false,
"files.autoSave": "onFocusChange",
"terminal.integrated.defaultProfile.osx": "zsh"
}