Use visual Studio code to open a browser to view HTML files

Source: Internet
Author: User

Vscode always use sublime, the latter when writing HTML files can be the right mouse button to find open in browser to start the system default browser, and Vscode does not have this function, debugging and preview is more troublesome. However, you can fix this problem by configuring the Tasks.json file.

Press ctrl+p to open the command panel , type Tasks.json and enter to open the file, you can see the default configuration, and then modify the following:

{    //See http://go.microsoft.com/fwlink/?LinkId=733558    //For the documentation about the Tasks.json format"Version": "0.1.0",    "Command": "Chrome", // using the Chrome browser "Windows": {        "Command": "C:/Program Files (x86)/google/chrome/application/chrome.exe" //The path of the Chrome browser     },    "Isshellcommand":true,    "Args":["${file}"], // indicates the operation of the current file "Showoutput": "Always"}

After saving open an HTML file, press the key combination ctrl+shift+b You can use the specified browser to open the HTML file.

Use visual Studio code to open a browser to view HTML files

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.