"Sublime" pretty JSON plugin installation and configuration

Source: Internet
Author: User
Tags sublime text

  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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.