---
title: "mac上sublime 支持json, xml 格式化"
author: "squll369"
date: "2013-12-01T10:57:48Z"
tags: []
categories: ["开源软件"]
slug: "mac-sublime-json-xml"
draft: false
lastmod: "2013-12-01T10:57:48Z"
id: 1983409
url: "https://squll369.iteye.com/blog/1983409"
---

利用Tidy来format,

 

1\. 首先下载插件的 python 代码 （https://gist.github.com/coldnebo/1138554）, 我放在附件里了。

2\. 讲这2个文件复制到“~/Library/Application Support/Sublime Text 2/Packages/User”

3\. 打开如下的菜单：

   
![](http://dl2.iteye.com/upload/attachment/0091/7332/cc6a0e6d-3a20-39da-a91e-35317592b961.png)

 

4\. 在里面添加如下内容：

{ "keys": \["ctrl+shift+x"], "command": "tidy\_xml" },

    { "keys": \["ctrl+shift+j"], "command": "prettify\_json" },

 

![](http://dl2.iteye.com/upload/attachment/0091/7334/5e214e35-dc92-3fec-99da-b78e0c510951.png)  
 

 快捷键设置好了！可以使用了。