0

I learned how to open HTML files on a Mac in Chrome via Cmd + shift + b from the accepted answer here, but I miss being able to easily choose any browser like I can by right clicking in Sublime Text. How to view my HTML code in browser with Visual Studio Code?

Is there anyway to make shortcuts to do this in Visual Studio Code?

I'm stuck because I don't know why cmd + shift + b is the shortcut to open the HTML page in Chrome (I'm assuming it has something to do with "building" the app) so I don't know how I'd be able to make separate build commands / shortcuts for each browser.

Gwater17
  • 2,018
  • 2
  • 19
  • 38

2 Answers2

0

Looks like you can set desired keyboard shortcuts to tasks via the key property. Example:

{
"key": "ctrl+h",
"command": "workbench.action.tasks.runTask",
"args": "build"
}

Additional details can be found here: https://code.visualstudio.com/docs/editor/tasks#_binding-keyboard-shortcuts-to-tasks

Chris Smith
  • 399
  • 3
  • 16
0

The only way I've found to view HTML files in a different browser on Mac is to change my default browser (by clicking on the Apple menu and selecting System Preferences >> General >> Default web browser >> choose the browser you want) select default browser, then in VSCode right clicking on the html.index file and selecting either "Open With Live Server" or "View In Browser" view in browser

AJL
  • 9
  • 3