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文件 ...
随机推荐
- TCP协议和UDP协议基础介绍
TCP协议和UDP协议区别 标签(空格分隔): TCP,udp TCP的三次握手 TCP被称为可靠的数据传输协议,主要是通过许多机制来实现的其中最主要的就是三次握手的功能,当然,TCP传送数据的机制非 ...
- oracle数值函数 abs()、 ceil()、 cos()、 cosh()
1.abs绝对值函数 格式 abs(number) 即abs(数值) 例如 abs(100) 结果为 100,abs(-100)结果为100: 2.ceil用来取数值最小整数函数 格式 ceil(nu ...
- mysql-----04 多表查询
本节主要介绍mysql的多表查询(多表连接查询.复合条件查询.子查询) 一.多表连接查询 #重点:外链接语法 select 字段列表 from 表1 inner|left|right join 表2 ...
- 19-03【golang】strings包
golang的strings包提供了字符串操作的一系列函数.下面做个简单介绍 函数 用法 备注 Compare(a,b sring) 比较两个字符串 Contains(s, substr stri ...
- Codeforces Round #552 (Div. 3) B题
题目链接:http://codeforces.com/contest/1154/problem/B 题目大意:给出n个数,每个数都可以加上或减去这个一个数D,求对这n个数操作之后当所有数都相等时,D的 ...
- Spring常用注解总结(2)
@Autowired "自动填装",作用是为了消除代码JAVA代码里面的getter/setter与bean属性中的property. @Autowired默认按类型匹配的方式,在 ...
- Eclipse使用相关配置
问题描述:The word is not correctly spelled问题分析:eclipse校验单词拼写造成,出现在配置文件中,会影响到程序的正常执行解决方案:在eclipse下的Window ...
- linklist和arraylist区别
ArrayList更适合读取数据,linkedList更多的时候添加或删除数据.
- python 微信轰炸
from __future__ import unicode_literals import requests import itchat import time def get_news(): ur ...
- Django实现文件的上传
Django实现文件的上传 1.前端页面:使用file对象,读取文件对象传递到views中.需要设定enctype="multipart/form-data",表明不对字符进行编码 ...