Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Pattern SwitchNew to Visual Studio Code? Get it now.
Pattern Switch

Pattern Switch

Creasty

|
566 installs
| (0) | Free
Switch the text under cursor to alternative patterns
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

vscode-pattern-switch

Switch the text under cursor to alternative patterns.

Configuration

  • patternSwitch.replaceRules
  • patternSwitch.toggleRules

Please refer the contributions in package.json for more details.

Command & keybinding

  • Command: patternSwitch.switchUnderCursor

Recommended keybindings:

{
  "key": "-",
  "command": "patternSwitch.switchUnderCursor",
  "when": "editorTextFocus && vim.active && vim.mode == 'Normal'"
},
{
  "key": "ctrl+l",
  "command": "patternSwitch.switchUnderCursor",
  "when": "editorTextFocus && vim.active && vim.mode == 'Insert'"
}

Default rules

General:

Pattern Description
_+_, + Add/remove spaces around operators: */%<>&+-|^=~?!$#@\:.,'`
true, false
on, off
yes, no
TRUE, FALSE
ON, OFF
YES, NO
public, protected, private
import, export
if, unless
bottom, top
down, up
left, right

Golang:

Pattern Description
chan, <-chan, chan<- Channel: RW <> R <> W

Ruby:

Pattern Description
:foo, 'foo' Symbol <> String
foo: ..., 'foo' => ... Symbol key <> Hash rocket syntax

RSpec:

Pattern Description
it, xit Mark/unmark as pending
describe, xdescribe Mark/unmark as pending
context, xcontext Mark/unmark as pending
scenario, xscenario Mark/unmark as pending
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft