Visual Studio Code extension that provides commands to format JSON
- Open a new file and enter some unformatted JSON
- Open the command palette and run
Pretty JSON: Prettify
- Run
Pretty JSON: Uglify
to revert back to the unformatted JSON
By default, this extension does not define any keybindings in order to avoid interfering with existing settings.
However, the commands provided by this extension can be bound to any keybinding.
This can be done by opening the command palette, searching for Preferences: Open Keyboard Shortcuts (JSON)
, and adding something like the following:
[
{ "key": "ctrl+shift+p", "command": "vscode-pretty-json.prettify" },
{ "key": "ctrl+shift+u", "command": "vscode-pretty-json.uglify" }
]