sublime text 3 配置浏览器预览路径 localhost -尊龙游戏旗舰厅官网
原文链接:http://jingyan.baidu.com/article/15622f2419ce79fdfcbea5ea.html
按步骤设置成功!感谢大侠!
以下是原文:
sublime text 3 受到程序员的喜爱,被誉为码农神器,具体优点就不说了。在 sublime text 3 中,可以对当前编辑的页面调用浏览器进行预览,但是默认的浏览器路径为文件所在的磁盘路径,这样如果是php、asp文件的话,就不能正常工作,那么怎么配置浏览器默认的浏览路径为localhost呢,且听分解。
工具/原料
- sublime text 3
- sidebarenhancements
方法/步骤
在 sublime text 3 中,安装 sidebarenhancements 侧边栏增强插件。
sidebarenhancements 插件安装完成后,首先为 sidebarenhancements 指定默认浏览器。打开 " preference --> package settings --> side bar --> settings user-user"
在打开的文件中添加:
{
"default_browser": "chrome" //one of this list: firefox, aurora, chrome, canary, chromium, opera, safari,
"portable_browser": "d:/program files/mozilla firefox/firefox.exe",
// "portable_browser": "d:/program files/ucbrowser/application/ucbrowser.exe",
}
默认的浏览器可以是列表中的任意一种,在这里我选择的是chrome,可以根据自己的情况进行选择。
portable_browser是自定义的,可直接指定浏览器。
为 sidebarenhancements 指定默认localhsot目录。在侧边栏任意文档上点击鼠标右键,选择 "project --> edit preview urls"
在打开的文件中添加如下内容:
{"e:/klaus/work/":{
"url_testing": "http://localhost/",
"url_production": "http://localhost/"
}
}
1、"e:/website/helloworld/" 是项目在磁盘中的路径,请修改为你的项目地址
2、"url_testing" 是你本地的 localhost 地址
3、 "url_production" 是项目线上地址
请根据自己的情况进行修改。
为浏览器绑定热键。
在 sublime text 3 中,打开 "preference --> package settings --> side bar --> key bindings-user",在打开的文件中添加如下内容:
[
{
"keys": ["f12"],
"command": "side_bar_open_in_browser",
"args": {
"paths": [],
"type": "testing",
"browser": ""
}
}
]
在此,我为浏览器绑定的热键是 "f12",可以根据自己的使用习惯进行修改。
至此,所有设置已经完成,可以在页面中按相应的热键,调用在配置文件中设置好的浏览器进行浏览。
end注意事项
- 用 package control 安装的 sidebarenhancements 只支持 sublime text 3,不支持旧版本的 sublime text 2
转载于:https://www.cnblogs.com/pthlp/p/4866919.html
总结
以上是尊龙游戏旗舰厅官网为你收集整理的sublime text 3 配置浏览器预览路径 localhost的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇:
- 下一篇: