Support template in vim syntax highlighting

This commit is contained in:
Fabrice Reix 2022-06-12 18:34:12 +00:00 committed by jcamiel
parent e5d3cbe729
commit 1e3c16192f
2 changed files with 7 additions and 5 deletions

View File

@ -20,9 +20,10 @@ syntax match EscapeQuote "\\\""
syntax match Section "\[[A-Za-z]*\]"
syntax match Number "\s[0-9]*"
syntax region String start='"' end='"' contains=EscapeQuote
syntax region String start='```' end='```'
syntax region Json start='{' end='}'
syntax region String start='"' end='"' contains=EscapeQuote
syntax region String start='```' end='```'
syntax region Json start='{' end='}' contains=Template
syntax region Template start='{{' end='}}'
" colors
@ -34,5 +35,6 @@ highlight Json ctermfg=green
highlight Number ctermfg=lightblue
highlight EscapeNumberSign ctermfg=white
highlight EscapeQuote ctermfg=green
highlight Template ctermfg=red

View File

@ -1,5 +1,5 @@
# This is a comment
GET http://example.com
GET http://{{host}}
Header1: Value1
Header2: a\# # value with \#
Header3: GET
@ -15,7 +15,7 @@ body not contains "\"\#"
POST http://example.com
{
"id": 123,
"id": {{id}},
"message": "Hello"
}