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

Java​Script Multiline

by summersw ALL

Sublime plugin for creating multiline text arrays from selected text

Details

  • 2013.09.23.16.15.06
  • github.​com
  • github.​com
  • 12 years ago
  • 5 years ago
  • 12 years ago

Installs

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