Just wanted to add that UTF-8 with BOM also messes things up, at least it did for me in VSCode. since the invisible character would break the block templates:
+<U+FEFF>{{define "main"}}
In VSCode just click “UTF-8 with BOM” at the bottom right, then select “save with encoding” and then “UTF-8”