1
1
# Sublime Text - View In Browser
2
2
3
3
* <a href =" http://adampresley.github.io/sublime-view-in-browser/ " >View In Browser</a >* is a Sublime Text plugin that will open whatever is in your
4
- current view/tab. If the file current open is new and has not been saved a temporary
5
- file is created (in your default temp directory for your OS) with the extension of
4
+ current view/tab. If the file current open is new and has not been saved a temporary
5
+ file is created (in your default temp directory for your OS) with the extension of
6
6
** .htm** and your browser will open it. However if the current open file is saved
7
7
and has a name this plugin will open it in whatever you have set to handle
8
8
its type.
@@ -24,7 +24,30 @@ you can use and configure are in the key named **supportedBrowsers**.
24
24
The ** supportedBrowsers** values can be configured to have paths to your browser installations.
25
25
Each browser listed is an array (list) of configurations that allow you to setup a browser
26
26
for multiple operating systems. For example under * chrome* there are two configurations.
27
- The first is for your average Linux system. The second is for Windows.
27
+ The first is for your average Linux system. The second is for Windows.
28
+
29
+ ## Other Browsers
30
+ View In Browser also provides key bindings to open your current view in browser other than
31
+ your ** selectedBrowser** . Below is a listing of the keys and what browser open with
32
+ those key bindings.
33
+
34
+ * * CTRL + ALT + F* - Firefox
35
+ * * CTRL + ALT + C* - Chrome
36
+ * * CTRL + ALT + I* - Internet Explorer
37
+ * * CTRL + ALT + S* - Safari
38
+
39
+ Like any other key binding in Sublime these can be changed. Below is an example of the
40
+ key configuration. You can remap these in your User key bindings configuration file.
41
+
42
+ ``` javascript
43
+ [
44
+ { " keys" : [ " ctrl+alt+v" ], " command" : " view_in_browser" },
45
+ { " keys" : [ " ctrl+alt+f" ], " command" : " view_in_browser" , " args" : { " browser" : " firefox" } },
46
+ { " keys" : [ " ctrl+alt+c" ], " command" : " view_in_browser" , " args" : { " browser" : " chrome" } },
47
+ { " keys" : [ " ctrl+alt+i" ], " command" : " view_in_browser" , " args" : { " browser" : " iexplore" } },
48
+ { " keys" : [ " ctrl+alt+s" ], " command" : " view_in_browser" , " args" : { " browser" : " safari" } }
49
+ ]
50
+ ```
28
51
29
52
### Windows Considerations
30
53
One of the things you may notice in the Windows configuration for * chrome* is a variable in
@@ -45,20 +68,20 @@ Here is a list of supported variables:
45
68
* ** My Music** - Path to your music ___location
46
69
47
70
Note that many of these are not terribly useful for determining browser ___location, unless you
48
- have decided to install Firefox in your My Music folder.
71
+ have decided to install Firefox in your My Music folder.
49
72
50
73
51
74
## Configure to View on Local Server
52
75
The View In Browser plugin also supports the ability to view files in the context of
53
76
a local server. So if you have a local Apache, Tomcat, or some other server application running
54
- you can configure this plugin to open your file prefixed with a URL.
77
+ you can configure this plugin to open your file prefixed with a URL.
55
78
56
79
To configure this the View In Browser plugin reads the configuration of your currently
57
80
loaded project. You can edit a project file by opening the * sublime-project* file
58
- by choosing ** Project** -> ** Edit Project** . In your project file you will need to specify
81
+ by choosing ** Project** -> ** Edit Project** . In your project file you will need to specify
59
82
two things:
60
83
61
- * ** baseUrl** - The root URL to prefix files with
84
+ * ** baseUrl** - The root URL to prefix files with
62
85
* ** basePath** - The base path where your site/application lives
63
86
64
87
Here's how that looks.
@@ -95,18 +118,18 @@ of the FILE protocol.
95
118
* Backslashes in Windows are now converted to forward slashes when using
96
119
a local server configuration. Closes <a href =" https://github.com/adampresley/sublime-view-in-browser/issues/16 " >#16 </a >
97
120
* 04/16/2013:
98
- * Added support for muliple paths per browser configuration (jadient
121
+ * Added support for muliple paths per browser configuration (jadient
99
122
<a href =" https://github.com/adampresley/sublime-view-in-browser/pull/14 " >#14 </a >)
100
123
* 03/08/2013:
101
124
* Avoid loading Windows special folder references when on a Mac
102
125
* Added Mac Chrome to the supported browsers list
103
126
* 02/18/2013:
104
- * Added ability to use Windows special folder references to browser commands. Closes
127
+ * Added ability to use Windows special folder references to browser commands. Closes
105
128
<a href =" https://github.com/adampresley/sublime-view-in-browser/issues/10 " >#10 </a >
106
129
* 01/30/2013:
107
130
* All settings for this plugin now live in the file ** View In Browser.sublime-settings** .
108
- This allows for a user to override them in their * User* directory. The old
109
- ** settings.json** file is no longer used.
131
+ This allows for a user to override them in their * User* directory. The old
132
+ ** settings.json** file is no longer used.
110
133
* 01/28/2013:
111
134
* Merged in change from imaginationac to remove menu nesting
112
135
* 12/26/2012:
@@ -134,13 +157,13 @@ of the FILE protocol.
134
157
The MIT License (MIT)
135
158
Copyright (c) 2012 Adam Presley
136
159
137
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
138
- to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
160
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
161
+ to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
139
162
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
140
163
141
164
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
142
165
143
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
144
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
145
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
166
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
167
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
168
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
146
169
IN THE SOFTWARE.
0 commit comments