Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Multi Selection ReplaceNew to Visual Studio Code? Get it now.
Multi Selection Replace

Multi Selection Replace

valerioio

|
205 installs
| (0) | Free
Replace all the selections of text with the result of an expression.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Multi Selection Replace

Replace all the selections of text with the result of a JavaScript expression.

Usage

  1. Select the text that you want to replace (you can creat multiple selectors holding down Alt while clicking with the mouse)
  2. Press Ctrl + Alt + M on Windows, Cmd + Alt + M on Mac
  3. Provide a JavaScript expression in the input box at the top of the screen. You can use:
    • e: to reference the current element
    • i: to reference the current index
    • a: to reference the whole array of selections
  4. Press Enter

Examples

Increasing sequence

Using JavaScript expression i+1...

increasing sequence

Increasing sequence (2nd example)

Using JavaScript expression e+1...

increasing sequence (2nd example)

Fibonacci sequence

Using JavaScript expression a[i] = i < 2 ? i : a[i] = a[i-2] + a[i-1]...

fibonacci sequence

Source Code

Github repository with the source code here.

1.0.0

Initial release.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft