Smartly expand or shrink your code selection, recover from misclicks or accidental cursor moves.
- Token Expansion: Expands to character tokens with customizable patterns.
- Quote Expansion: Expands to content within quotes (
"
,'
,`
). - Scope Expansion: Expands to content within open-close pairs (
[]
,{}
,()
). - Line Expansion: Expands to full line(s) content.
- Selection History: Remember previous selections for step-by-step shrinking.
Text: const config = { url: 'https://example.com' };
With cursor on `xamp`, next expansions will be:
→ example
→ example.com
→ https://example.com
→ 'https://example.com'
→ url: 'https://example.com'
→ { url: 'https://example.com' }
→ const config = { url: 'https://example.com' }
→ const config = { url: 'https://example.com' };
Command | Default Keybinding | Description |
---|---|---|
genericExpandSelection.expand |
Ctrl+E (Win/Linux), Cmd+E (Mac) |
Expand Selection |
genericExpandSelection.shrink |
Ctrl+Shift+E (Win/Linux), Cmd+Shift+E (Mac) |
Shrink Selection |
Tip
Both commands work with single and multiple cursor selections.
You can customize how selection expansion works by configuring settings in your VS Code settings.json
.
# Install dependencies
pnpm install
# Type check and lint (TypeScript and ESLint)
pnpm run check
# Run tests (builds TypeScript, runs esbuild, then executes tests)
pnpm run test
# Watch for changes and rebuild
pnpm run watch
# Build, type check, lint, and package extension as out.vsix
pnpm run build
# Build and install the packaged extension locally (outputs out.vsix and installs it)
pnpm run local
MIT License