summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean@guyomarch.bzh>2018-08-03 20:13:38 +0200
committerJean Guyomarc'h <jean@guyomarch.bzh>2018-08-03 20:13:38 +0200
commit50932caff28acde7369abb93cfa5732ed64e1290 (patch)
treed09d109ac7e2da451a2eb432d248bf2dc8131545
parent8febb2e4df5006e2e980c0927fb4164891b55347 (diff)
syntax: add support for textual EET representation
Eet can be manipulated via a textual representation, which looks like the following: group "s_config" struct { value "version" uint: 0; value "font_size" uint: 12; value "font_name" string: "Mono"; group "bg_color" struct { group "s_config_color" struct { value "r" uchar: 0; value "g" uchar: 0; value "b" uchar: 0; value "a" uchar: 255; } } value "use_bg_color" uchar: 0; value "mute_bell" uchar: 0; } These changes allow vim to properly colorize textual eet files. The associated file extension is ".eet".
-rw-r--r--ftdetect/eet.vim2
-rw-r--r--syntax/eet.vim28
2 files changed, 30 insertions, 0 deletions
diff --git a/ftdetect/eet.vim b/ftdetect/eet.vim
new file mode 100644
index 0000000..1263891
--- /dev/null
+++ b/ftdetect/eet.vim
@@ -0,0 +1,2 @@
1" Textual EET representation
2au BufRead,BufNewFile *.eet set filetype=eet
diff --git a/syntax/eet.vim b/syntax/eet.vim
new file mode 100644
index 0000000..046efa7
--- /dev/null
+++ b/syntax/eet.vim
@@ -0,0 +1,28 @@
1" Vim syntax file
2" Language: EET
3"
4" This syntax file supports the textual representation of eet files. That is,
5" the output of `eet -d` (conversely, the input of `eet -i` and `eet -e`).
6" This is convenient when `vieet` is used.
7
8if version < 600
9 syntax clear
10elseif exists("b:current_syntax")
11 finish
12endif
13
14syn keyword eetSection group value key count
15syn keyword eetType struct array var_array list hash uint string uchar char
16syn keyword eetType short int long_long float double ushort ulong_long
17syn keyword eetType inlined
18syn keyword eetNull null
19syn match eetNumber display "\d\+"
20syn region eetString start=+L\="+ end=+"+
21
22hi def link eetSection Label
23hi def link eetType Type
24hi def link eetNumber Number
25hi def link eetString String
26hi def link eetNull Constant
27
28let b:current_syntax = "eet"