Expand and shrink a structured VS Code selection
Control-Shift-Command-Right Arrow expands a smart selection; the Left Arrow variant shrinks it when the editor and language support that structure.
- Scope
- Visual Studio Code · Current vendor documentation checked 3 November 2026; no running-app compatibility test is claimed.
- Keyboard and customization
- Documented Mac defaults; punctuation and function keys depend on keyboard layout and hardware.. User bindings, app versions, focused controls and installed extensions can change a command. Inspect the active app menu or its shortcut editor when a listed combination differs.
- Review basis
- Documentation reviewed 2026-11-03 by Codex — primary-documentation and editorial review; no hands-on runtime test. These bindings were not tested in a running app for this guide.
Start from the code you want to encompass
Place the cursor inside the relevant expression or structure, then expand one step and inspect the highlighted range. A structured selection can be useful for wrapping, extracting or moving a coherent piece of code without manually counting characters. Its boundaries depend on the language information available to the editor.
Stop before the selection becomes too broad
Repeated expansion can eventually encompass more code than the intended edit. Use the shrink variant to return through smaller boundaries rather than typing into an oversized selection. The fact that a range is syntactically recognisable does not mean that replacing or moving it is semantically safe.
Compare with ordinary text selection
Try the commands inside a simple expression and then in a larger block, without modifying the file. If the ranges are not useful, use ordinary selection or inspect the language configuration instead. Smart selection is a context-sensitive convenience, not a universal rule that every document type implements identically.
Documented commands for this workflow
Scroll the table sideways to see every column.
Sources and corrections
- Default keyboard shortcuts — Visual Studio Code — checked 2026-11-03
- Basic editing — Visual Studio Code — checked 2026-11-03
Found a mismatch? Email pashaseenainc@gmail.com with your app version, macOS version, keyboard layout and the command. Please leave personal document names out.
Keep going
Right there when you need it.
Keep a compact shortcut reference in your Mac’s menu bar.
Explore the native Mac app