ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Wrap

🤖 Sublime Text plugin that "passes" text selected or under cursor into brackets

Details

Installs

  • Total 193
  • Win 131
  • Mac 28
  • Linux 34
Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
Linux 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

🤖 Wrap

Wrap is a simple but useful Sublime Text plugin that wraps the selected text (or text under cursor) with brackets (example: pass as argument into function/method, pass as index/key into array/list).

🎬 Demonstration

Wrap: Wrap

💻 Installation

The easiest way to install Wrap is through Package Control. After it is enabled inside Sublime Text, open the command palette and find Package Control: Install Package and press ENTER. Then, find Wrap in the list. Press ENTER again, and this plugin is installed!

📈 Usage

This plugin includes the command wrap, which can be run in the command palette as Wrap: Wrap.

Running the Wrap: Wrap command, the text selected or under cursor will be wrapped by brackets (bracket type can be customized). A placeholder will be inserted before the starting bracket and become selected.

Example:

  • Original code: x (x is selected or under cursor)
  • After Wrap: Wrap: abc(x) (abc selected)

âš™ Customization

The Wrap plugin can be customized to your requirements.

🔧 Preferences

The type of brackets used by Wrap can be customized via the command Preferences: Wrap.

Simply change the bracket_type to your preference.

⌨ Keybindings

Keybindings can be created for the wrap command.

  • Run the Preferences: Wrap Key Bindings command in the command palette.
  • Add your keybindings!

Below is an example of the keybinding file:

[
    {
        "keys": ["alt+w"],
        "command": "wrap"
    }
]