When I started learning Golang recently, I used .tmpl as a web template. However, I found that it couldn’t handle formatting automatically like HTML files. P.S. Even with related plugins installed, it only processes .html files.

After checking some related documents, I found that I can modify user settings to handle it. Here are two methods:

The first method is to directly modify the settings.json file and add the following code at the bottom:

    "files.associations": {
        "*.tmpl": "html"

The second method is to go to Settings, click Text Editor, and add *.tmpl as html.

The final result will look like this!