Skip to content

Instantly share code, notes, and snippets.

@borekb
Created February 25, 2017 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save borekb/269391102b75c4196a811dd805336dd5 to your computer and use it in GitHub Desktop.
Save borekb/269391102b75c4196a811dd805336dd5 to your computer and use it in GitHub Desktop.
VS Code 'Open in browser' task
  1. Configure tasks
  2. Paste from below
  3. Ctrl+Shift+B on an HTML file
{
"version": "0.1.0",
"command": "Chrome Canary",
"windows": {
"command": "C:\\Users\\borek\\AppData\\Local\\Google\\Chrome SxS\\Application\\chrome.exe"
},
"args": ["${file}"]
}
@myfonj
Copy link

myfonj commented Sep 22, 2021

For custom keyboard shortcut:

  1. Open Keyboard Shortcuts (JSON)
  2. Paste from below
  3. Change "key": "ctrl+shift+alt+c", to your desired shortcut
  4. Make sure "args": value matches "command" name from tasks.json

keybindings.json

  {
    "key": "ctrl+shift+alt+c",
    "command": "workbench.action.tasks.runTask",
    "args": "Chrome Canary" // = the "command" value of the task
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment