Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>superpowersNew to Visual Studio Code? Get it now.
superpowers

superpowers

thykka

|
278 installs
| (1) | Free
Edit your document with JavaScript functions
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Superpowers

This VSCode extension gives you superpowers in the form of JavaScript expressions, that can be used to map or sort multi-selections.

Preview

Superpowers Superpresets

Features

  • Perform map operations on a selection or multiple selections
  • Perform sort operations on multiple selections
  • Perform reduce operations on multiple selections
  • Generate text via JavaScript expressions
  • Save your expressions as presets for easy access
  • Support for dynamic snippets / completions

Map/Sort operation usage

  1. Select some text. Optionally, use Cmd to select multiple regions.

  2. Press Cmd + Shift + P to open the command palette.

  3. Type "super" to show a list of available commands;

    Custom map function

    Type a JavaScript map callback function and press enter. Your function will get applied to each selection.

    Map Presets

    Pick a preset to use as the map function.

    Custom sort function

    Type a JavaScript sort comparison function and press enter to sort the selections.

    Sort Presets

    Pick a preset to use as the sort function.

    Custom reduce function

    Type a JavaScript reduce function and press enter to output the result after the selections.

    Sort Presets

    Pick a preset to use as the reduce function.

Dynamic snippets / completion

Currently, only plaintext and markdown documents are supported, and only two snippets are available;

  • RT - Inserts the current time, rounded to 15 minutes
  • TD - Calculates the time delta between two times

Type a snippet, and the autocompletion menu should appear.

Extension Settings

This extension contributes the following settings:

  • superpowers.mapPresets: List of map presets as an array of objects.

    Example:

    {
      "name": "replace with index",
      "function": "(_, i) => i + 1"
    }
    
  • superpowers.sortPresets: List of sort presets as an array of objects.

    Example:

    {
      "name": "sort by codepoint",
      "function": "(a, b) => a.charCodeAt(0) - b.charCodeAt(0)"
    }
    
  • superpowers.reducePresets: List of reduce presets as an array of objects.

    Example:

    {
      "name": "sum numbers",
      "function": "(sum, val) => parseFloat(sum) + parseFloat(val)"
    }
    

Known Issues

Please report issues via issue tracker.

Release Notes

Extension is still in early phases of development. Expect things to change or be broken.

Development

  1. Open project in VS Code
  2. Select Debug > Start Debugging [F5]
  3. ¯\_(ツ)_/¯ hack away!

Building

  1. Ensure all changes have been committed.

  2. $ vsce package
    
    $ vsce publish [patch/major/minor]
    
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft