dzhibas / SublimePrettyJson

Prettify/Minify/Query/Goto/Validate/Lint JSON plugin for Sublime Text 3 & 4
MIT License
2.03k stars 180 forks source link

Feature request - sort_keys setting per command #174

Closed grizzlydev-sarl closed 2 years ago

grizzlydev-sarl commented 2 years ago

Sometimes I need to prettify a json without sorting keys, sometimes I need the keys to be sorted. Currently, one has to go to the settings and change the sort_keys value to specifiy which behavior to use.

It would be terrific if we could have two commands to prettify a json, one with sort_keys disabled, the other with sort_keys enabled, taking precedence over the global sort_keys setting.

For instance

// prettify without sorting keys
{ "keys": [ "ctrl+shift+j" ], "command": "pretty_json_unsorted" }
// prettify and sort keys
{ "keys": [ "ctrl+shift+alt+j" ], "command": "pretty_json_sorted" }

Cheers.

edit: typo

grizzlydev-sarl commented 2 years ago

I just noticed that a command to prettify and sort already exists: pretty_json_and_sort Wonderful!

Sorry for the noise