sublime text3如何在浏览器预览?
插件: view-in-browser
CTRL + ALT + V 打开浏览器
默认打开firefox,settings里面可修改。
Sublime Text - View In Browser
View In Browser is a Sublime Text plugin that will open whatever is in your current view/tab. If the file current open is new and has not been saved a temporary file is created (in your default temp directory for your OS) with the extension of .htm and your browser will open it. However if the current open file is saved and has a name this plugin will open it in whatever you have set to handle its type.
By default the keystroke assigned to this plugin is CTRL + ALT + V.
Installation
Using the Sublime Text Package Control plugin (http://wbond.net/sublime_packages/package_control) press CTRL + SHIFT + P and find Package Control: Install Package and press Enter. Find this plugin in the list by name View In Browser.
Configuring Browsers
By default this plugin will open files in Firefox. You can configure it to open using another browser of your choice. To do this, choose Settings - User from Preferences > Package Settings > View In Browser.
The browser you wish to use to open files is set in the key named browser. The following is a list of browsers configured for use out of the box.
- Firefox - Mac OS, Linux, Windows
- Chrome - Mac OS, Linux, Windows
- Chrome64 - Windows
- Yandex - Windows
- Safari - Mac OS
- Internet Explorer - Windows
- Chromium - Linux
Other Browsers
View In Browser also provides key bindings to open your current view in browser other than your browser setting. Below is a listing of the keys and what browser open with those key bindings.
- CTRL + ALT + F - Firefox
- CTRL + ALT + C - Chrome
- CTRL + ALT + I - Internet Explorer
- CTRL + ALT + S - Safari
Like any other key binding in Sublime these can be changed. Below is an example of the key configuration. You can remap these in your User key bindings configuration file.
[
{ "keys": [ "ctrl+alt+v" ], "command": "view_in_browser" },
{ "keys": [ "ctrl+alt+f" ], "command": "view_in_browser", "args": { "browser": "firefox" } },
{ "keys": [ "ctrl+alt+c" ], "command": "view_in_browser", "args": { "browser": "chrome" } },
{ "keys": [ "ctrl+alt+i" ], "command": "view_in_browser", "args": { "browser": "iexplore" } },
{ "keys": [ "ctrl+alt+s" ], "command": "view_in_browser", "args": { "browser": "safari" } }
]Windows Considerations
One of the things you may notice in the Windows configuration for chrome is a variable in the command path that looks like: %Local AppData%. This is a reference to your Windows installation's AppData folder in your user profile directory. There is a variable there because this value will differ for each user on your computer, and Chrome installs to your AppData folder.
Here is a list of supported variables:
- AppData - Your main application data folder for your profile (usually roaming)
- Personal - Your documents location
- Desktop - The path to your Desktop location (may be unreliable)
- Start Menu - The path to your Start Menu items location
- Local AppData - Your local application data folder for your profile
- My Video - Path to your videos location
- My Pictures - Path to your pictures location
- My Music - Path to your music location
Note that many of these are not terribly useful for determining browser location, unless you have decided to install Firefox in your My Music folder.
Configure to View on Local Server
The View In Browser plugin also supports the ability to view files in the context of a local server. So if you have a local Apache, Tomcat, or some other server application running you can configure this plugin to open your file prefixed with a URL.
To configure this the View In Browser plugin reads the configuration of your currently loaded project. You can edit a project file by opening the sublime-project file by choosing Project -> Edit Project. In your project file you will need to specify two things:
- baseUrl - The root URL to prefix files with
- basePath - The base path where your site/application lives
Here's how that looks.
{
"folders":
[
{
"path": "/home/<username>/code/python/my-cool-website"
}
],
"settings": {
"sublime-view-in-browser": {
"baseUrl": "http://localhost:8080",
"basePath": "/home/<username>/code/python/my-cool-website"
}
}
}Notice the key named settings which is a dictionary that contains another key named sublime-view-in-browser. This is where you will put your baseUrl and basePath settings.
Now when you activate View In Browser your file will open with the HTTP protocol instead of the FILE protocol.
sublime text3如何在浏览器预览?的更多相关文章
- Sublime Text 3 配置浏览器预览路径 localhost
原文链接:http://jingyan.baidu.com/article/15622f2419ce79fdfcbea5ea.html 按步骤设置成功!感谢大侠! 以下是原文: Sublime Tex ...
- sublime txt 设置在浏览器预览
1. 安装SideBarEnhancements插件 ctrl+shift+p —> Install Package —> 找到SideBarEnhancements 2. 配置预览快捷键 ...
- 在sublime text 3中设置浏览器预览快捷键
1.安装 SideBarEnhancements ctrl+shift+p,进入命令模式,然后输入package control(或者直接输 pci 或许也行),回车: 输入:SideBarEnhan ...
- 设置sublime text2/3中默认预览浏览器快捷键的方法
各位前端大神们,大家在用IDE编辑器的时候喜欢用哪些呢?是Dreamweaver.Zend Studio.editplus又或者是sublime text?今天马浩周给大家就要说说设置sublime ...
- sublime3下载安装及常用插件、浏览器预览设置
之前与学习前端有关的软件都安装在了实验室电脑上,最近由于要放寒假(也许我寒假回去会学习呢),于是得在笔记本电脑上重新安装一遍.几个软件各种出错,花了一下午才安装好,必须记录下来啊! 这篇文章主要介绍s ...
- Window 7 平台的IE11浏览器预览版发布
继之前Windows 8.1 带来了IE11浏览器之后,今天Window 7 以及Windows Server 2008 R2平台的IE11浏览器预览版也已经发布. 当然这还只是一个开发者预览版,可能 ...
- vscode如何用浏览器预览运行html文件
1,打开vscode编辑器,点击编辑器主界面左上侧第五个小图标——‘扩展’按钮: 2,进入扩展搜索右拉框,在应用商店搜索框中输入“view in browser”会自动进行搜索 3,等待几秒钟时间,扩 ...
- Sublime Text3 实现在浏览器中以HTML格式预览md文件
1.首先找到Package Control 打开Sublime Text3,找到菜单栏:Preferences → Package Control,没有找到Package Control,那么点击Pa ...
- sublime实现markdown浏览器预览
效果预览 实现 首先下载插件OmniMarkupPreviewer 方法:ctrl + shift + P 安装完成后搜索'OmniMarkupPreviewer'双击即可 下载完成后新建.md文件 ...
随机推荐
- nginx开机启动
centos 7以上是用Systemd进行系统初始化的 Systemd服务文件以.service结尾,比如现在要建立nginx为开机启动,如果用yum install命令安装的,yum命令会自动创建n ...
- CentOS 6.8下网卡配置、桥接模式和NAT连接模式、VMware虚拟机克隆网卡配置
模式一:桥接模式: 1. 在VMware中安装好虚拟机后,虚拟机网卡设置:选择桥接模式 2. 查看本机的网络信息: 找到ip.子网掩码.网关.DNS等. 找一个没有使用的ip,例如:192.168.1 ...
- java百度云推送
实体类: import java.io.Serializable; import javax.persistence.Entity; /** * * @Version : 1.0 * @Author ...
- CSS标签的加载
CSS加载不会阻塞DOM树解析 CSS加载会阻塞DOM树的渲染 CSS加载会阻塞后面JS语句的执行
- phpstorm界面不停的indexing,不停的闪烁
选择 File->Invalidate Caches / Restart...->Invalidate and Restart,就行了!
- Linux Apache配置https访问
配置https访问 该环境是rh254课程配套的一个环境,不过配置方法步骤相同. 要求: 使用虚拟主机技术部署两个网站: 网站1: 绑定域名 www0.example.com 目录在 /srv/www ...
- hashCode 与 equals
面试官可能会问你:“你重写过 hashcode 和 equals 么,为什么重写equals时必须重写hashCode方法?” hashCode()介绍 hashCode() 的作用是获取哈希码, ...
- 贪吃蛇(简易版)Leslie5205912著
# include <stdio.h># include <string.h># include <windows.h># include <stdlib.h ...
- Codeforces Round #552 (Div. 3) D题
题目网站:http://codeforces.com/contest/1154/problem/D 题目大意:给出n个数(0或1),还有a , b, a是蓄电池容量,b是电池容量,数为1时蓄电池可以充 ...
- idea中springboot项目设置热部署
技术交流群:816227112 File-Settings-Compiler-Build Project automatically ctrl + shift + alt + /然后选择Registr ...