Merge pull request #39 from grenade/master

Hint for mapping keys to `un_pretty_json` command.
This commit is contained in:
Nikolajus 2014-06-17 12:50:50 +02:00 committed by Nikolajus Krauklis
commit a1dfd652d4
2 changed files with 13 additions and 1 deletions

View File

@ -5,8 +5,14 @@
],
"command": "pretty_json"
},
{
"keys": [
"ctrl+alt+m"
],
"command": "un_pretty_json"
},
{
"keys": ["ctrl+alt+shift+j"],
"command": "jq_pretty_json"
}
]
]

View File

@ -29,6 +29,12 @@ If JSON is not valid it will be displayed in status bar of Sublime Text
Using Command Palette <kbd>Ctrl+Shift+P</kbd> find "Pretty JSON: Minify (compress) JSON" (you can search for part of it like 'json minify') this will make selection or full buffer as single line JSON which later you can use in command lines (curl/httpie) or somewhere else...
To map a key combination like <kbd>Ctrl+Alt+M</kbd> to the Minify command, you can add a setting like this to your .sublime-keymap file (eg: `Packages/User/Default (Windows).sublime-keymap`):
```
{ "keys": [ "ctrl+alt+m" ], "command": "un_pretty_json" }
```
### Convert JSON to XML
Using Command Palette <kbd>Ctrl+Shift+P</kbd> search fo "Pretty JSON: JSON 2 XML" (you can search for part of it like '2XML') this will convert your selected JSON of full buffer to XML and replace syntax and buffer to XML output