@math2001 and @laktak STās config files allow trailing commas and comments. The userās Preferences.sublime-settings
file is the only one that doesnāt keep them when changing something e.g. via command palette. I use trailing commas and comments in keymaps, projects and plugin configs.
@delucia your keymap doesnāt have to look so bad if you format it better, e.g.:
[
{
"keys": ["backspace"],
"command": "left_delete",
},
{
"keys": ["shift+backspace"],
"command": "left_delete",
},
{
"keys": ["ctrl+shift+backspace"],
"command": "left_delete",
},
{
"keys": ["delete"],
"command": "right_delete",
},
{
"keys": ["enter"],
"command": "insert",
"args": { "characters": "\n" },
},
{
"keys": ["shift+enter"],
"command": "insert",
"args": { "characters": "\n" },
},
]
@twoolie people will know that PyYaml is actually parsing their config because ST will probably get slower on startup. Here is a Ruby benchmark and Python benchmark. Maybe somebody could do a benchmark of ST startup time with YAML vs JSON parser. I love ST for its speedy startup and actually I also love JSON for its unambiguity (though no comments and no trailing commas sucks, which ST āfixedā).
@bosinski your plugin could keep YAML configs in a folder, which get converted to JSON on save (e.g. Preferences.yaml
becomes Preferences.sublime-settings
). That way you keep the original YAML with comments and also have the performance benefit of JSON. Youād need to hook into the Preferences menu somehow.