Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add commands for "default" option #69

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,29 @@ By default the keystroke assigned to this plugin is *CTRL + ALT + V*.
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
By default this plugin will open files in your default browser. 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*.

For example, to set Chrome as your default browser:

```JSON
{
"browser": "chrome"
}
```

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
|Browser|Value|Supported OS|
|---|---|---|
|Default|`default`|macOS, Linux, Windows|
|Firefox|`firefox`|macOS, Linux, Windows|
|Chrome|`chrome`|macOS, Linux, Windows|
|Chrome64|`chrome64`|Windows|
|Yandex|`yandex`|Windows|
|Safari|`safari`|macOS|
|Internet Explorer|`iexplore`|Windows|
|Chromium|`chromium`|macOS, 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.
Expand Down Expand Up @@ -91,6 +102,8 @@ Now when you activate View In Browser your file will open with the HTTP protocol

## Change History

* 05/09/2017:
* Add support for default browser
* 03/11/2016:
* Fix issue where parenthesis in paths would cause a failure to load. Solves #52
* 10/06/2014:
Expand Down
11 changes: 8 additions & 3 deletions View In Browser.sublime-settings
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
{
"posix": {
"linux": {
"default": "xdg-open",
"firefox": "firefox -new-tab",
"chrome": "google-chrome",
"chrome64": "google-chrome",
"chromium": "chromium"
"chromium": "chromium-browser"
},
"linux2": {
"default": "xdg-open",
"firefox": "firefox -new-tab",
"chrome": "google-chrome",
"chrome64": "google-chrome",
"chromium": "chromium"
"chromium": "chromium-browser"
},
"darwin": {
"default": "open",
"firefox": "open -a \"/Applications/Firefox.app\"",
"safari": "open -a \"/Applications/Safari.app\"",
"chrome": "open -a \"/Applications/Google Chrome.app\"",
"chrome64": "open -a \"/Applications/Google Chrome.app\"",
"chromium": "open -a \"/Applications/Chromium.app\"",
"yandex": "open -a \"/Applications/Yandex.app\""
}
},
"nt": {
"win32": {
"default": "start",
"firefox": "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe -new-tab",
"iexplore": "C:\\Program Files\\Internet Explorer\\iexplore.exe",
"chrome": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
Expand All @@ -30,5 +35,5 @@
}
},

"browser": "firefox"
"browser": "default"
}