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

Java​Script Multiline

by metatribal ST2/ST3

Sublime plugin for creating multiline text arrays from selected text

Details

  • 2013.09.23.16.15.06
  • github.​com
  • github.​com
  • 4 years ago
  • 1 hour ago
  • 4 years ago

Installs

  • Total 13K
  • Win 9K
  • OS X 2K
  • Linux 2K
Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8
Windows 1 10 8 15 16 6 7 9 7 3 11 11 9 11 5 10 1 7 9 10 8 5 8 6 6 11 14 14 8 4 5 11 13 10 21 9 6 10 11 10 10 9 6 4 7 5
OS X 0 0 1 4 3 0 1 2 1 2 1 2 1 4 0 1 3 2 3 0 1 0 1 1 2 0 3 2 0 2 0 1 3 4 2 0 2 1 2 0 1 2 0 2 0 1
Linux 0 1 0 1 1 1 0 1 1 0 1 1 0 1 2 2 0 2 0 0 2 1 0 0 1 1 3 1 2 0 1 0 1 0 1 1 0 1 3 5 0 4 0 1 2 0

Readme

Source
raw.​githubusercontent.​com

sublime-jsmultiline

Sublime plugin for creating multiline text arrays from selected text.

This plugin will take selected text and convert it to a javascript array of lines with a join() statement at the end. For example, the following text

this is some text
 that spans multiple lines.
It even works with "double quotes", 'single quotes', and \backslashes\.

is converted to

['this is some text',
' that spans multiple lines.',
'It even works with \"double quotes\", \'single quotes\', and \\backslashes\\.'].join('\n');

The new text remains selected and is suitable for cutting and pasting into a variable assignment such as,

var mystring = ['this is some text',
' that spans multiple lines.',
'It even works with \"double quotes\", \'single quotes\', and \\backslashes\\.'].join('\n');

If multiple regions are selected, each region will be converted.

The default keybinding is ctrl-alt-j/super-alt-j

Enjoy!

License

This package is licensed under the Apache License, version 2. See LICENSE file for details.