@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.