https://github.com/leny/atom-wrap-and-pad
Wrap and pad selection.
https://github.com/leny/atom-wrap-and-pad
Last synced: 7 months ago
JSON representation
Wrap and pad selection.
- Host: GitHub
- URL: https://github.com/leny/atom-wrap-and-pad
- Owner: leny
- Created: 2015-11-06T12:33:14.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-29T23:05:14.000Z (over 10 years ago)
- Last Synced: 2024-12-29T08:42:54.838Z (over 1 year ago)
- Language: JavaScript
- Size: 1.13 MB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `Wrap and pad` package
> Wrap and pad selection.
This package is inspired by [gepoch/vim-surround](https://github.com/gepoch/vim-surround).
* * *

## How it works ?
**wrap-and-pad** use the configuration object to store pairs of characters, so you can add your own. Default values are :
"wrap-and-pad":
pairs: [
name: "parenthesis"
start: "("
pad: " "
end: ")"
,
name: "brackets"
start: "["
pad: " "
end: "]"
,
name: "curly-brackets"
start: "{"
pad: " "
end: "}"
]
For each property in the `pairs` object, **wrap-and-pad** will generate a command named : `wrap-and-pad:wrap-and-pad-with-[name]`, which you can bind to any keys within your keymap file.
By default, **wrap-and-pad** is shipped with three commands :
- `wrap-and-pad:wrap-and-pad-with-parenthesis`
- `wrap-and-pad:wrap-and-pad-with-brackets`
- `wrap-and-pad:wrap-and-pad-with-curly-brackets`
### Trim selection before wrapping
You can also trim the selection before wrapping & padding, with the `trim-before` configuration key.