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

Newline Seperated to List

by jeechu ALL

A Sublime Text package that converts newline separated document to a list

Details

Installs

  • Total 361
  • Win 197
  • Mac 119
  • Linux 45
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 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15
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 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0
Mac 0 0 0 0 0 0 1 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 1
Linux 1 0 1 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

NewlineSeparatedToList for Sublime Text 3

This package makes converting newline separated document (or selection of document) to a list easier.

Settings

Set ask_for_bracket_type to false and default_bracket_type to avoid having to select backet type every time.

NOTE: Setting ask_for_bracket_type and not setting default_bracket_type will show the prompt to select bracket anyway.

{
    "ask_for_bracket_type": false,
    "default_bracket_type": "curved"
  }

Accepted bracket types

Bracket Type Example
curved ( )
square [ ]
curly { }
none

Usage

Tools -> Command Palette (Ctrl+Shift+P or Cmd+Shift+P)

Options: * Newline to List: Double quotes - adds double quotes to each item in list, escapes any double quotes already present * Newline to List: No quotes - no quotes will be added * Newline to List: Single quotes - adds single quotes to each item in list, escapes any single quotes already present * Newline to List: Dynamic double quotes - adds double quotes to each non-digits item in list, escapes any double quotes already present * Newline to List: Dynamic single quotes - adds single quotes to each non-digits item in list, escapes any single quotes already present

Examples

one
  two
  three
  4
  five

  # Becomes (with square brackets)
  ["one", "two", "three", "4", "five"]    #with double quotes
  [one, two, three, 4, five]              #with no quotes
  ['one', 'two', 'three', '4', 'five']    #with single quotes
  ["one", "two", "three", 4, "five"]      #with dynamic double quotes
  ['one', 'two', 'three', 4, 'five']      #with dynamic single quotes
one
  two
  three
  4
  five

  # Becomes (with no brackets)
  "one", "two", "three", "4", "five"      #with double quotes
  one, two, three, 4, five                #with no quotes
  'one', 'two', 'three', '4', 'five'      #with single quotes
  "one", "two", "three", 4, "five"        #with dynamic double quotes
  'one', 'two', 'three', 4, 'five'        #with dynamic single quotes