Sublime text 3指定游览器打开localhost路径

前端学习1 13.9K1字数 1155阅读3分51秒阅读模式

网上大部分教程打开localhost都是默认游览器,如何指定自己想要的游览器呢?

下面把自己的方法分享出来文章源自亦枫博客-https://yflad.cn/28.html

首先你需要安装sublime和wamp,不会的小伙伴可以参考以下链接文章源自亦枫博客-https://yflad.cn/28.html

1、Sublime Text 3最新版简单配置文章源自亦枫博客-https://yflad.cn/28.html

2、Wampserver3.0.6配置文章源自亦枫博客-https://yflad.cn/28.html

 文章源自亦枫博客-https://yflad.cn/28.html

 文章源自亦枫博客-https://yflad.cn/28.html

首先需要安装“侧边栏增强插件”,不会的可以看这个链接(Sublime text 3配置文章源自亦枫博客-https://yflad.cn/28.html

安装完,打开“Preference --> Package Settings --> Side Bar --> Settings - User文章源自亦枫博客-https://yflad.cn/28.html

Sublime text 3指定游览器打开localhost路径文章源自亦枫博客-https://yflad.cn/28.html

添加如下内容:文章源自亦枫博客-https://yflad.cn/28.html

  1. {
  2.   "default_browser": "firefox", //one of this list: firefox, aurora, chrome, canary, chromium, opera, safari
  3.   "portable_browser": "D:/borwer/Mozilla Firefox/firefox.exe"
  4. }

上面一行为你指定的游览器,你可以填chrome,360等文章源自亦枫博客-https://yflad.cn/28.html

下面一行尤为重要,也是实现自定义游览器的必须步骤,将游览器的安装目录填入保存即可文章源自亦枫博客-https://yflad.cn/28.html

 文章源自亦枫博客-https://yflad.cn/28.html

然后指定你项目的地址文章源自亦枫博客-https://yflad.cn/28.html

打开侧边栏 → 选择任意一个文档,点击鼠标右键文章源自亦枫博客-https://yflad.cn/28.html

打开“Project --> Edit Preview URLs”文章源自亦枫博客-https://yflad.cn/28.html

Sublime text 3指定游览器打开localhost路径文章源自亦枫博客-https://yflad.cn/28.html

添加如下内容:文章源自亦枫博客-https://yflad.cn/28.html

  1. {
  2.     "E:/www/":{
  3.         "url_testing": "http://localhost/",
  4.         "url_production": ""
  5.     }
  6. }

"E:/www/":{                                                     //此为你的项目地址文章源自亦枫博客-https://yflad.cn/28.html

"url_testing": "http://localhost/",          //此为你的localhost地址文章源自亦枫博客-https://yflad.cn/28.html

"url_production": ""                               //这个是你的线上项目

根据自己需求填写

 

下面配置快捷键打开

打开“Preference --> Package Settings --> Side Bar --> key Bindings-User”

Sublime text 3指定游览器打开localhost路径

添加如下内容:

  1. [
  2. {
  3.         "keys": ["ctrl+shift+b"],
  4.         "command": "side_bar_open_in_browser",
  5.         "args": {
  6.                     "paths": [],
  7.                     "type": "testing",
  8.                     "browser": ""
  9.                 }
  10.     }
  11. ]

“ctrl+shift+b”是快捷键,因为有时候会用几个游览器查看兼容性

 

下面随便打开个文件试试,这样就OK了!!!

Sublime text 3指定游览器打开localhost路径

继续阅读
扫扫关注公众号
weinxin
我的微信
扫扫体验小程序
weinxin
我的公众号
亦枫
  • 本文由 发表于 2017年5月25日 04:33:09
评论  1  访客  1
    • 不知所措
      不知所措 1

      嘿嘿嘿

    匿名

    发表评论

    匿名网友 填写信息

    :?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

    确定

    取消