sublime-text3设置浏览器预览html

时间:2023-03-09 19:46:03
sublime-text3设置浏览器预览html

选择:Tools - Build System - New Build Syatem...

或者:工具 - 编译系统 - 新编译系统

然后粘贴代码

{
"cmd": ["chrome", "${file}"],
"working_dir": "${file_path}",
"shell":true,
"variants":
[
{
"name": "Run",
"cmd": [ "firefox","${file}"]
}
]
}

保存为html.sublime-build

将其中的chrome和firefox换成相应浏览器的路径(注意windows下斜杠可能要换一下,比如:C:/Program Files (x86)/Google/Chrome/Application/chrome.exe

然后编写html的时候选择 编译系统- html

预览的时候 ctrl+B启动chrome打开html,shift+ctrl+B启动firefox 打开html