Skip to content

Commit 89f4548

Browse files
Initial commit
0 parents  commit 89f4548

12 files changed

+198
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.gitattributes export-ignore
2+
demo export-ignore

Default (Linux).sublime-keymap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// [
2+
// {
3+
// "keys": ["alt+w"],
4+
// "command": "wrap"
5+
// },
6+
// ]

Default (OSX).sublime-keymap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// [
2+
// {
3+
// "keys": ["alt+w"],
4+
// "command": "wrap"
5+
// },
6+
// ]

Default (Windows).sublime-keymap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// [
2+
// {
3+
// "keys": ["alt+w"],
4+
// "command": "wrap"
5+
// },
6+
// ]

Default.sublime-commands

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[
2+
{
3+
"caption": "Wrap: Wrap",
4+
"command": "wrap"
5+
},
6+
{
7+
"caption": "Preferences: Wrap Key Bindings",
8+
"command": "edit_settings",
9+
"args": {
10+
"base_file": "${packages}/Wrap/Default (${platform}).sublime-keymap",
11+
"default": "[\n\t$0\n]\n"
12+
}
13+
},
14+
{
15+
"caption": "Preferences: Wrap",
16+
"command": "edit_settings",
17+
"args": {
18+
"base_file": "${packages}/Wrap/Wrap.sublime-settings",
19+
"default": "{\n\t$0\n}\n"
20+
}
21+
},
22+
{
23+
"caption": "Wrap: Open Readme",
24+
"command": "open_file",
25+
"args": {
26+
"file": "${packages}/Wrap/README.md"
27+
}
28+
}
29+
]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 futureprogrammer360
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# 🤖 Wrap
2+
3+
[Wrap](https://github.com/futureprogrammer360/Wrap) is a simple but useful [Sublime Text](https://www.sublimetext.com/) 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).
4+
5+
## 🎬 Demonstration
6+
7+
<img src="demo/demo.gif" alt="Wrap: Wrap" width="750"></img>
8+
9+
## 💻 Installation
10+
11+
The easiest way to install Wrap is through [Package Control](https://packagecontrol.io/packages/Wrap). 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!
12+
13+
## 📈 Usage
14+
15+
This plugin includes the command `wrap`, which can be run in the command palette as `Wrap: Wrap`.
16+
17+
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.
18+
19+
Example:
20+
21+
* Original code: `x` (`x` is selected or under cursor)
22+
* After `Wrap: Wrap`: `abc(x)` (`abc` selected)
23+
24+
## ⚙ Customization
25+
26+
The Wrap plugin can be customized to your requirements.
27+
28+
### 🔧 Preferences
29+
30+
The type of brackets used by `Wrap` can be customized via the command `Preferences: Wrap`.
31+
32+
Simply change the `bracket_type` to your preference.
33+
34+
### ⌨ Keybindings
35+
36+
Keybindings can be created for the `wrap` command.
37+
38+
* Run the `Preferences: Wrap Key Bindings` command in the command palette.
39+
* Add your keybindings!
40+
41+
Below is an example of the keybinding file:
42+
43+
```json
44+
[
45+
{
46+
"keys": ["alt+w"],
47+
"command": "wrap"
48+
}
49+
]
50+
```

Wrap.sublime-settings

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
// Type of brackets to use (examples: (), [], {})
3+
"bracket_type": "()"
4+
}

demo/demo.gif

527 KB
Loading

messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"install": "messages/install.txt"
3+
}

0 commit comments

Comments
 (0)