haldis/etc/vim/syntax.vim

60 lines
2.1 KiB
VimL
Raw Normal View History

2020-01-24 01:17:30 +01:00
" Vim syntax file
" Language: HLDS
" Maintainer: Zeus WPI
" quit when a syntax file was already loaded.
if exists("b:current_syntax")
finish
endif
" We need nocompatible mode in order to continue lines with backslashes.
" Original setting will be restored.
let s:cpo_save = &cpo
set cpo&vim
syn match hldsLocationAttribute "^\t[a-z0-9_-]\+ " display contained nextgroup=hldsLocationAttributeValue
syn match hldsLocationAttributeValue "[^\n]\+$" display contained
syn region hldsLocationHeader matchgroup=hldsLocationHeaderDelim
\ start="^====*$" end="^====*$"
2020-01-24 22:03:15 +01:00
\ contains=hldsLocationAttribute,hldsComment
2020-01-24 01:17:30 +01:00
2020-01-26 23:51:29 +01:00
syn keyword hldsBlockType dish nextgroup=hldsBlockIdAftrKywrd skipwhite
2020-01-24 01:17:30 +01:00
syn keyword hldsChoiceType single_choice multi_choice nextgroup=hldsBlockIdAftrKywrd skipwhite
syn match hldsBlockId "^[a-z0-9_-]\+: "
syn match hldsBlockIdAftrKywrd "[a-z0-9_-]\+: " contained
syn match _doubleSpace " \+" nextgroup=hldsTag,hldsPrice
syn match hldsTag "{[a-z0-9_-]\+}\( \|$\)" contained nextgroup=hldsTag,hldsPrice
syn match hldsPrice "€ *[0-9]\+\(\.[0-9]\+\|\)\( \|$\)" contained
2020-01-24 01:17:30 +01:00
syn match hldsComment "#.*$" contains=hldsTodo,@Spell
syn keyword hldsTodo FIXME NOTE NOTES TODO XXX contained
2020-01-24 01:17:30 +01:00
" trailing whitespace
syn match hldsSpaceError display excludenl "\s\+$"
" spaces instead of tabs
syn match hldsSpaceError display "^\t* "
" The default highlight links. Can be overridden later.
hi def link hldsLocationHeader Function
hi def link hldsLocationHeaderDelim hldsLocationHeader
hi def link hldsLocationAttribute hldsLocationHeader
hi def link hldsChoiceType Statement
hi def link hldsBlockType Statement
hi def link hldsBlockId Include
hi def link hldsBlockIdAftrKywrd hldsBlockId
hi def link hldsPrice Number
hi def link hldsTag String
hi def link hldsSpaceError Error
hi def link hldsComment Comment
hi def link hldsTodo Todo
2020-01-24 01:17:30 +01:00
2020-01-24 22:03:15 +01:00
syntax sync minlines=5
2020-01-24 01:17:30 +01:00
let b:current_syntax = "hlds"
let &cpo = s:cpo_save
unlet s:cpo_save