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
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 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1
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.