安装插件

执行菜单【Tools】-【Command Palette】,或者CMD+SHIFT+P,打开命令面板,输入关键词“install package”,下拉选择【Package Control: Install Package】,然后输入要搜索的插件名称,模糊匹配查询后,下拉选择要安装的插件即可安装。

可以通过CTRL+`组合键来打开控制台查看命令的执行日志。

如果执行时报错误,比如出现

“Package Control: Error downloading package. HTTP exception InvalidCertificateException”。

可以尝试在【Preferences > Package Settings > Package Control > Settings - User】打开配置文件后,在其中添加:

"downloader_precedence":
{
"osx":
[
"curl"
]
},

这个配置的含义在【Preferences > Package Settings > Package Control > Settings - Default 】配置文件中有注释,用来控制下载使用的库。

// The downloader backends that should be used for HTTP(S) requests, split
// by operating system to allow for configuration to be shared.
//
// Valid options include: "urllib", "curl", "wget", (Windows-only) "wininet"
//
// This setting allows Windows users to bypass wininet and use urllib
// instead if they machine or network presents trouble to wininet. Some
// OS X and Linux users have also reported better luck with certain proxies
// using curl or wget instead of urllib.
//
// The "curl" and "wget" options require the command line "curl" or "wget"
// program installed and present in the PATH.
"downloader_precedence": {
"windows": ["wininet"],
"osx": ["urllib"],
"linux": ["urllib", "curl", "wget"]
},

打开自动换行

执行菜单【Tools】-【Command Palette】,或者CMD+SHIFT+P,打开命令面板,输入关键词“word wrap”, 下拉选择【Word Wrap: Toggle】,可以打开/关闭自动换行

或者执行【View】-【Word Wrap】。

显示打开文件的字符编码格式

安装插件“ShowEncoding”。安装完成后,在编辑器的左下角默认会展示当前打开文档的编码格式。

格式化JSON

安装插件“Pretty JSON”。安装完成后,在命令面板(CMD+SHIFT+P),输入“Pretty JSON”即可以选择相关的命令来格式化或者压缩json格式。