VsCode syntax highlighting for tmpl files

3.293 visualizzazioni
Passa al primo messaggio da leggere

cinem...@gmail.com

da leggere,
23 set 2019, 11:25:5223/09/19
a golang-nuts

Is there way to highlight templates files (.tmpl) in VSCode? There is an extension gotemplate-syntax but seems it doesn't make the job.


{{define "side"}}
    <h3>New Books</h3>
    <p>There's nothing here</p>
{{end}}

Subramanian Sridharan

da leggere,
24 set 2019, 01:32:5524/09/19
a golang-nuts
Nunjucks seems to do the trick.


ext install extension nunjucks

When you save a file with some file extension, VSCode automatically prompts you to install a related VSCode extension.
That's how I came to know about this extension. 

cinem...@gmail.com

da leggere,
24 set 2019, 03:00:2224/09/19
a golang-nuts
thnks, it's better than nothing

Denis Bakhtin

da leggere,
25 set 2019, 10:18:5125/09/19
a golang-nuts
This extension works well if templates have .gohtml extension. I had to rename mine.

Andreas

da leggere,
28 set 2019, 11:19:2028/09/19
a golang-nuts
nice

Andreas

da leggere,
13 ott 2019, 11:49:5813/10/19
a golang-nuts
the drawback is when I enter in .gohtml file

```{{```

then vscode auto-copletes it with

```}}}```

did you get the same?


On Wednesday, September 25, 2019 at 5:18:51 PM UTC+3, Denis Bakhtin wrote:

Soyaib Zihad

da leggere,
15 mar 2024, 13:40:3015 mar
a golang-nuts
"files.associations": {
"*.tmpl": "html"
}
add this to settings.json in vs-code and life is good.
Rispondi a tutti
Rispondi all'autore
Inoltra
0 nuovi messaggi