Skip to content

a VSCode extension that replace selected string with custom JavaScript function.

License

Notifications You must be signed in to change notification settings

Xotchkass/map-replace.js

 
 

Repository files navigation

map-replace.js for VSCode

Replace selected string with custom JavaScript function.

Visual Studio Marketplace VS Installs VS Rating

Features

gif

Examples

const things = [
  'Thing',
  'Thing',
  'Thing',
  'Thing',
  'Thing',
  'Thing',
  'Thing',
]

Make selections on all Thing strings, call the command and enter custom transform function:

(value, index) => `${value} #${index}`

Then generates:

const things = [
  'Thing #0',
  'Thing #1',
  'Thing #2',
  'Thing #3',
  'Thing #4',
  'Thing #5',
  'Thing #6',
]

Credits

Idea from @zetavg

License

MIT

About

a VSCode extension that replace selected string with custom JavaScript function.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%