Once upon a time, a girl named Talia was taking a coding bootcamp & following along diligently with all the examples her instructors were coding. Every time she needed to lớn view her code in a browser, she would: right click và navigate to the “Open In Browser” menu item. This was a tedious process that disrupted her workflow. She thought lớn herself, isn’t there a better way?
And there is!
Behold: View in Browser
This is a sublime package that allows you khổng lồ set a custom keyboard shortcut to lớn “Open in Browser”.
Bạn đang xem: View in browser not working?
The Steps
If you already have Package Control installed in Sublime Text, please skip this section.
Installing Package Control
Open your Console in Sublime by using the shortcut ctrl + ` or navigating khổng lồ View > Show ConsolePress enter. This may take several seconds.Restart Sublime Text.Congratulations! You now have access to lots of packages for Sublime, not just the one outlined in this tutorial. View popular packages here.
Installing View In Browser Package
Phew, hard part over!
You should now have a text entry window xuất hiện overtop of your Sublime page, as shown below:
Command Palette xuất hiện in Sublime Text.
3. Begin to lớn type “install Package”. You should see the option for “Package Control: Install Package” appear. Select this option & press Enter
If you vày not, it means Package Control has not installed properly. Please restart Sublime again. If that fails, please visit your best friend google for further assistance!
4. There will be a short pause, before new options appear in the Command Palette. Search again for “View In Browser”. Select this option và press Enter.
If it does not appear, it means you already have it installed, good job!
5. You’re done! View In Browser Package is installed!

Let’s Use This Thing!
By default, this package allows you to open a Sublime Text document khổng lồ the browser Firefox using the shortcut Alt+Ctrl+V.
I would lượt thích to customize please!I decided lớn customize the shortcut key map and the default browser. For more information on customization, please refer lớn the documentation for this Package. Xem thêm: Cách Chỉnh Khoảng Cách Dòng Trong Excel 2010, 2016, 2013, 2007, 2019
Browser Customization
I decided to update my default browser khổng lồ be Chrome. Other browsers are also accepted, for naming conventions, please see the documentation.
Navigate through the menus as follows: Sublime Text > Preferences > Package Settings > View in Browser > Settings — User.Important: vị not edit the ‘Settings — Default’ page as this may break the package! This is a great resource to lớn understand what settings can be changed but should be considered read-only!
2. The file that opens should be blank. In this blank document simply copy the following code:
"browser": "chrome",3. Save the document.
4. Close và try the short cut again: Alt+Ctrl+V.
You should now have your webpage open in Chrome!
Shortcut Customization
I chose khổng lồ customize my keyboard shortcut lớn Command + E as it was close lớn the other keys I was using in this sequence và only two keys instead of three.
However, this does override an existing shortcut in Sublime that allows you to lớn copy the current selection and put it in the ‘find’ field. (This is referred khổng lồ as ‘slurp_find_string’, more here).
So choose what works for you!
Navigate through the menus as follows: Sublime Text > Preferences > Key Bindings.This will open a new window in Sublime with two files. One file is the mặc định Key Binding settings for Sublime and should not be altered. The blank document or document whose name ends in ‘User’, is the one we want khổng lồ work with.In the User file: copy the following code:< “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” >4. These are the default ‘key maps’ for View In Browser.
5. We can now edit this code with the new keyboard shortcut we want! My code ended up looking lượt thích this:
< “keys”: < “super+e” >, “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” >“Super” is the name of the “command” key on Mac computers.