summaryrefslogtreecommitdiffstats
path: root/syntax
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2014-04-15 01:16:56 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2014-04-15 01:16:56 +0200
commitd681cb59d301334232851d7c1568554e33416404 (patch)
tree4879ee09a88bff8b500ec470219b5ee046eb3fb1 /syntax
parent0b50acdddfb5a90f7b6c21b9c299452fe9b68534 (diff)
downloadvim-polyglot-d681cb59d301334232851d7c1568554e33416404.tar.gz
vim-polyglot-d681cb59d301334232851d7c1568554e33416404.zip
Add toml script, closes #20
Diffstat (limited to '')
-rw-r--r--syntax/toml.vim37
1 files changed, 37 insertions, 0 deletions
diff --git a/syntax/toml.vim b/syntax/toml.vim
new file mode 100644
index 00000000..8be0b3f0
--- /dev/null
+++ b/syntax/toml.vim
@@ -0,0 +1,37 @@
+" Language: TOML
+" Maintainer: Caleb Spare <cespare@gmail.com>
+" URL: http://github.com/cespare/vim-toml
+" LICENSE: MIT
+
+if exists("b:current_syntax")
+ finish
+endif
+
+syn match tomlEscape /\\[0tnr"\\]/ display
+hi def link tomlEscape SpecialChar
+
+syn region tomlString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=tomlEscape
+hi def link tomlString String
+
+syn match tomlInteger /\<-\?\d\+\>/ display
+hi def link tomlInteger Number
+
+syn match tomlFloat /\<-\?\d\+\.\d\+\>/ display
+hi def link tomlFloat Float
+
+syn match tomlBoolean /\<\%(true\|false\)\>/ display
+hi def link tomlBoolean Boolean
+
+syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}T\d\{2\}:\d\{2\}:\d\{2\}Z/ display
+hi def link tomlDate Constant
+
+syn match tomlKeyGroup /^\s*\[.\+\]\s*\(#.*\)\?$/ contains=tomlComment
+hi def link tomlKeyGroup Identifier
+
+syn keyword tomlTodo TODO FIXME XXX BUG contained
+hi def link tomlTodo Todo
+
+syn match tomlComment /#.*/ contains=@Spell,tomlTodo
+hi def link tomlComment Comment
+
+let b:current_syntax = "toml"