在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:dzhibas/SublimePrettyJson开源软件地址:https://github.com/dzhibas/SublimePrettyJson开源编程语言:Python 99.2%开源软件介绍:Prettify/Minify/Query/Goto/Validate/Lint JSON plugin for Sublime Text 3 & 4 UpdatesAll keybindings have been removed in favor of the Command Palette. And to allow for users to configure their own specific key bindings. This also prevents key binding overrides which conflict with other packages. For good documentation on key bindings I recommend you review the Offical Docs or Community Docs InstallationPackage Control (Recommended)Install this sublime text 3 / 4 package via Package Control search for package: "Pretty JSON" Manual InstallationSublime Text 4
Sublime Text 3
Sublime Text 2 No longer supported UsageTo prettify JSON, make selection of json (or else it will try to use full view buffer) and through Command Palette Ctrl+Shift+P find "Pretty JSON: Format JSON" (you can search for part of it like 'pretty format') If selection is empty and configuration entry use_entire_file_if_no_selection is true, tries to prettify whole file If JSON is not valid it will be displayed in status bar of Sublime Text Validate JSONUsing Command Palette Ctrl+Shift+P find "Pretty JSON: Validate" (you can search for partial string 'validate') this will validate selection or full file and will show in dialog if it's valid or invalid. In case of found errors view will jump to error and will highlight it Compress / Minify JSONUsing Command Palette Ctrl+Shift+P find "Pretty JSON: Minify 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 Ctrl+Alt+M to the Minify command,
you can add a setting like this to your .sublime-keymap file
(eg: { "keys": [ "ctrl+alt+m" ], "command": "un_pretty_json" } List of commands that can be mapped to shortcuts
Convert JSON to XMLUsing Command Palette Ctrl+Shift+P search for "Pretty JSON: json2xml" (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 ./jQ query/filter usageDemo: If on your machine "./jq" tool is available with ctrl+atl+shift+j you can run against your json. output will be opened in new view so you can once again apply jq on new buffer You can find instructions of tool here: ConfigurationCheck all the available configuration keys and their default values by using the Command Palette Ctrl+Shift+P and searching for Here's a run down of the existing parameters, their meaning, and how you can configure each of them:
Using tabs for indentationYou can change configuration key indent to string value "indent" : "\t", Be sure ContributorsOthersIf you YAMLing then maybe you interested in this plugin: PrettyYAML |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论