Visual Studio Code and open the program that is associated with the file’s extension. This article covers both Mac and Windows.
Mac
- CMD-Shift-P
- Tasks: Configure Task
- Add this JSON to the task
{
"version": "2.0.0",
"tasks": [
{
"label": "Open file",
"type": "shell",
"command": "open",
"args": ["${file}"]
}
]
}
Windows
- Ctrl-Shift-P or F1
- Tasks: Configure Task
- Add this JSON to the task file
{
"version": "2.0.0",
"tasks": [
{
"label": "Open file",
"type": "shell",
"command": "explorer.exe",
"args": ["${file}"]
}
]
}
References
How to view my HTML code in the browser with Visual Studio Code?