当前位置:   article > 正文

mac sublime text3安装pretty json_mac sublime3 prettyjson

mac sublime3 prettyjson

1.首先在线安装Package Control插件

在线安装:打开sublime text ,点击菜单中的 “View”→“Show Console”(或快捷键 Ctrl + ` )打开命令行,把下面的代码粘贴进去后回车即可:

import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())

2.安装Rretty Json 

cmd + shift +p,输入"Package...."

选中“Package Control: Install Package”并回车,然后通过输入插件的名字pretty json找到插件并回车安装即可。

 

3.使用command + ctrl + j快捷键来格式化当前页面的内容

格式化之前

{"status":200,"data":{"pageInfo":{"current":1,"pageSize":5,"maxPage":1,"total":1},"list":[{"coreRefId":"1000147","positionUseRatio":"0.58","weightUseRatio":"-"}]}}

格式化之后

  1. {
  2. "status": 200,
  3. "data": {
  4. "pageInfo": {
  5. "current": 1,
  6. "pageSize": 5,
  7. "maxPage": 1,
  8. "total": 1
  9. },
  10. "list": [
  11. {
  12. "coreRefId": "1000147",
  13. "positionUseRatio": "0.58",
  14. "weightUseRatio": "-"
  15. }
  16. ]
  17. }
  18. }

 

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/煮酒与君饮/article/detail/746831
推荐阅读
相关标签
  

闽ICP备14008679号