diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2017-06-12 02:44:57 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2017-06-12 02:48:42 +0200 |
commit | 03894cae4590b54ab4196a457203a1f947f21449 (patch) | |
tree | e128f0ba40e2ab9bd3eafd5e633383f0e4007173 | |
parent | 412100289e7b3ebde5423f2099e247d1d9e41634 (diff) | |
download | liberty-03894cae4590b54ab4196a457203a1f947f21449.tar.gz liberty-03894cae4590b54ab4196a457203a1f947f21449.tar.xz liberty-03894cae4590b54ab4196a457203a1f947f21449.zip |
Add VIM syntax highlight for "config"
-rw-r--r-- | libertyconf.vim | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libertyconf.vim b/libertyconf.vim new file mode 100644 index 0000000..0d2975e --- /dev/null +++ b/libertyconf.vim @@ -0,0 +1,26 @@ +" Since the liberty configuration format is nearly indistinguishable, +" this syntax highlight definition needs to be loaded with `set ft=libertyconf` +if exists("b:current_syntax") + finish +endif + +syn match libertyconfError "[^_[:alnum:][:space:]]\+" +syn match libertyconfComment "#.*" +syn match libertyconfSpecial "{\|}\|=" +syn match libertyconfNumber "[+-]\=\<\d\+\>" +syn match libertyconfBoolean "\c\<\(true\|yes\|on\|false\|no\|off\)\>" +syn match libertyconfNull "null" +syn match libertyconfEscape display "\\\([xX]\x\{1,2}\|\o\{1,3}\|.\|$\)" + \ contained +syn region libertyconfString start=+"+ skip=+\\\\\|\\"+ end=+"+ + \ contains=libertyconfEscape + +let b:current_syntax = "libertyconf" +hi def link libertyconfError Error +hi def link libertyconfComment Comment +hi def link libertyconfSpecial Special +hi def link libertyconfNumber Number +hi def link libertyconfBoolean Boolean +hi def link libertyconfNull Constant +hi def link libertyconfEscape SpecialChar +hi def link libertyconfString String |