Git Product home page Git Product logo

vsc-around's Introduction

Around extension for VS Code

Manage token around regions.

This is a bit of an evil-surround port by an Emacs refugee.


Features

Puts before and after token around selected regions.

Just invoke the around.around command and select the token you want to surround your selection with. Some tokens, like parenthesis, will try to be smart by inserting the correct balancing token. Other tokens, like ", will just surround the region with two identical tokens.

Configuration

around uses the mapping around.pairs to control mappings. Each key in the mapping is a string, and each value is a pair of strings. around uses the mapping as follows.

If the supplied trigger string (possibly multiple characters) is a key in the mapping, then the elements in the value are used to surround the selection.

Otherwise, around processes the trigger string character-by-character. For each character, it checks to see if it is a key in the mapping. If so, the value is used as a two-tuple of prefix and suffix text. If not, then a two-tuple with the character in each position is used. In both cases, the first element in the tuple is appended to the prefix text and the second is prepended to the suffix text.

To bind a specific surrounding to a keyboard shortcut, you can add the following code snippet in your keybindings.json.

[
  {
    "key": "ctrl+shift+9",
    "command": "extension.around",
    "args": {
      "start": "(",
      "end": ")"
    }
  }
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.