Sublime Forum

OpenInBrowser

#1

I’ve been using Sublime Text 2 and absolutely love it. I know it’s only in Alpha and I’m really looking forward to it’s release. I understand that it’s missing some features and I can’t figure out how to open a .htm file in my default browser. I’ve seen that’s it works in the released version for Windows and i tried adding the following to Default (OSX).sublime-keymap

{ “keys”: “f12”], “command”: “openInBrowser” }
]

Unfortunately that did not seem to help. I saw some references to OpeninBrowser.py and that it is supposed to be in my packages/HTML folder but it’s not there. If this is simply because it does not have full python support that I will just wait patiently, but if I am just missing something and anyone point me in the correct direction I would really appreciate it. Thanks in advance!

0 Likes

#2

The answer is contained (mostly) in a previous post titled
“Sublime Text 2 Open in Browser”
Copy the last block of code from the post into a python file. Name it whatever you want but make sure it has a “py” extension and place that file in the Packages/HTML folder.
Then, in your Default (OSX).sublime-keymap file, change “openInBrowser” to “open_browser”.
The documentation here
http://sublimetext.info/docs/en/conventions.html
explains an important difference between version 1 and 2 of Sublime Text.
Hope this helps.

0 Likes

#3

Thank you, I’ll take a look at it later tonight!

0 Likes