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 14K
  • Win 10K
  • OS X 2K
  • Linux 2K
Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7
Windows 3 5 2 7 15 7 3 5 9 3 6 10 11 12 5 6 10 6 11 7 7 3 10 8 8 6 2 9 12 6 8 11 5 9 3 6 6 12 13 4 7 12 6 11 6 7
OS X 1 0 1 1 2 1 1 0 2 1 3 0 3 1 0 1 1 2 4 1 1 2 2 2 0 0 1 0 0 0 0 0 2 0 4 3 0 1 1 3 2 2 2 2 0 2
Linux 0 1 1 2 4 2 1 2 1 2 2 0 2 1 1 0 0 2 1 2 0 3 1 1 0 2 0 1 0 0 1 0 1 2 0 0 2 1 3 0 0 2 0 0 3 2

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.