This package makes converting newline separated document (or selection of document) to a list easier.
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_typeand not settingdefault_bracket_typewill show the prompt to select bracket anyway.
{
"ask_for_bracket_type": false,
"default_bracket_type": "curved"
}| Bracket Type | Example |
|---|---|
| curved | ( ) |
| square | [ ] |
| curly | { } |
| none |
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
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