Zhanhailiang Date: 2014-10-08
1. Install pretty JSON using Package Manager
Slightly.
2. Common shortcut key description
Ctrl+alt+j formatting JSON strings ctrl+alt+m compressing JSON strings
These shortcuts can also be configured by modifying shortcut keys to configure default (Windows). Sublime-keymap from the definition, in the case of the author, whose configuration file exists in D:\Users\wade.zhan\AppData\Roaming\Sublime Text 2\packages\pretty Json\default (Windows). Sublime-keymap
[ {" keys": [ "Ctrl+alt+j" ], "command": "Pretty_json" }, { "keys": [ "CTRL + Alt+m " ], " command ":" Un_pretty_json " }]
3. JSON string converted to XML
The json2xml operation can be performed by invoking the command window:
For convenience, also available in D:\Users\wade.zhan\AppData\Roaming\Sublime Text 2\packages\pretty json\default (Windows). Sublime-keymap Add the appropriate shortcut key:
[ { "keys": [ "Ctrl+alt+j" ], "command": "Pretty_json" }, { "keys": [ " Ctrl+alt+m " ], " command ":" Un_pretty_json " }, { " keys ": [ " ctrl+alt+ Shift+m " ], " command ":" Json_to_xml " }]
4. Support./JQ Query/filter operation
Depending on the JQ tool, save the downloaded Jq.exe to your path path.
5. Pretty JSON basic configuration
{ "use_entire_file_if_no_selection": true,//the entire file is not selected by default "indent": 2,//default indent 2 spaces, can be customized to indent 4 spaces or a tab \ t "Sort_keys": false,//default is to do a natural sort of key, the habit of the classmate can be changed to format the natural sort of "ensure_ascii": false//default off, All non-ASCII encoded characters are Unicode-encoded when turned on}
The following example:
{"Test": {"test": "Testing"}}
When Ensure_ascii is turned on, formatting is available:
{" Test": { "test": "\u6d4b\u8bd5"} }
Formatting when ENSURE_ASCII is not turned on can be:
{"Test" : { "test": "Testing" }}
"Sublime" pretty JSON plugin installation and configuration