Transform (selected) text in atom editor.
A collection of usefull text transformations.
The inspiration for this package comes comes from several TextMate
packages. The small helpers like HTML > URI-Encode
are the only
thing I really miss, however I think these "transformations" of the
current selection are better bundled together. For example, one
might need to URI-encode a small snippet of text outside of a
.html
file.
- adds commands to apply [transformations][#transformations] to the selected text
- works with multiple selections (like the built-in
Edit > Text
Commands)
The following string methods from underscore.string
are included as commands:
- clean: (no more than 1 whitespace)
- trim: (remove whitespace around)
- swapCase:
Lorem Ipsum
=>lOREM iPSUM
- capitalize:
lorem ipsum
=>Lorem ipsum
- titleize:
lorem ipsum
=>Lorem Ipsum
- camelize:
lorem ipsum factory_bean
=>loremIpsumFactoryBean
- underscored:
Lorem Ipsum
=>lorem_ipsum
- dasherize:
Lorem Ipsum
=>Lorem-Ipsum
- humanize:
loremIpsum_FactoryBean
=>Lorem ipsum factory bean
- classify:
Lor.em Ip sum
=>LorEmIpSum
- slugify:
Lo!rem/ Ip = sum
=>lorem-ip-sum
- stripTags:
Lorem <br>Ipsum
=>Lorem Ipsum
- escapeHTML:
<b>Lorem Ipsum</b>
=><b>Lorem Ipsum</b>
- unescapeHTML:
<b>Lorem Ipsum</b>
=><b>Lorem Ipsum</b>
The following URI methods are also available (via URIjs
):
- encodeURI:
!Lorem&Ipsum!
=>%21Lorem%26Ipsum%21
- decodeURI:
Lorem%20%26%20Ipsum%20%5E%5E
=>Lorem & Ipsum ^^
Some additional built-ins:
- double:
Lorem
=>LoremLorem
- make sure that the replaced text is properly selected (not the old range)
I am currently thinking about these topics and would appreciate input from the community:
- how to organize the different commands internally
- how to organize different command (groups) wrt menus, etc?
- group it all in
Packages > Transform > …
and let the user configure which further menus to add where?
- group it all in
- does a base package extensible by plugins (ala
autocomplete-plus
) make sense?
Contributions are more than welcome.
You can also give input to the open questions.