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 365
  • Win 200
  • Mac 120
  • Linux 45
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 1 1 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
Mac 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 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

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