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
  • 2 hours ago
  • 4 years ago

Installs

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

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.