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

Installs

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