Tags

, , , , ,

I recently posted an article about how to get going with Sublime Text 3 and I mentioned that I use the SideBarEnhancements package. I thought it might be useful to make a post about setting up this one package as there are a few things I needed to do to get it going.

First and foremost, we will need to install the SideBarEnhancements package. If you don’t already have package control please see my previous post about setting up Sublime Text for instructions on how to get package control installed. With that done, continue on.

Install SideBarEnhancements

1. Launch the Command Palette with Ctrl+Shift+P

2. Open the “Package Control: Install Package” option (type “ip” for short)

3. Select “SideBarEnhancements” from the list (type “sbe” for short)

Configure SideBarEnhancements “Run With” Menu

SideBarEnhancements has a useful feature that allows you to add your prefered and commonly used web browsers to the “Run With” menu. This menu is available when you right click on a file in the folder side bar.

Setup Environment Variables for you browser locations

1. Create environment variables for the location of each web browser application executable
For example:
CHROME_BIN | C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
CHROME_CANARY_BIN | C:\Users\\AppData\Local\Google\Chrome SxS\Application\chrome.exe
note: Make sure to update the paths as appropriate to your environment

Setup “Run With” settings file

1. Launch the Command Palette with Ctrl+Shift+P

2. Open the “Package Control: Browse Packages” option (type “bp for short). This should open the folder location.

3. Navigate to or create the follwoing path: User > SideBarEnhancements > Open With

4. Open or create the “Side Bar.sublime-menu” file

5. Add or update the contents to with the following block. Make sure to update the paths as appropriate to your environment.

[
	{"id": "side-bar-files-open-with",
		"children":
		[
			{
				"caption": "Chrome Canary",
				"id": "side-bar-files-open-with-chrome-canary",

				"command": "side_bar_files_open_with",
				"args": {
					"paths": [],
					"application": "%CHROME_CANARY_BIN%\\chrome.exe",
					"extensions":".*" //any file with extension
				}
			},

			{"caption":"-"},

			{
				"caption": "Chrome",
				"id": "side-bar-files-open-with-chrome",

				"command": "side_bar_files_open_with",
				"args": {
					"paths": [],
					"application": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
					"extensions":".*" //any file with extension
				}
			},
			{
				"caption": "Internet Explorer",
				"id": "side-bar-files-open-with-ie",

				"command": "side_bar_files_open_with",
				"args": {
					"paths": [],
					"application": "C:\\Program Files\\Internet Explorer\\iexplore.exe",
					"extensions":".*" //any file with extension
				}
			}
		]
	}
]

6. Save your changes. You might need to restart Sublime Text for them to take effect.

Now when you right click on a file in the folder side bar you should have the option to run the file using one of your configured browsers as shown here.

SideBarEnhancementsRunWith

For more information about this feature or other SideBarEnhancment customization, see the GitHub documentation.

Advertisements