X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/ff172ac1470e9d8f3b8a96a0b21ff958cd4d1612..eea5ddf237360145433d8604c13e1633a3315d42:/vim/syntax/rosmsg.vim?ds=sidebyside diff --git a/vim/syntax/rosmsg.vim b/vim/syntax/rosmsg.vim new file mode 100644 index 0000000..11e4632 --- /dev/null +++ b/vim/syntax/rosmsg.vim @@ -0,0 +1,39 @@ +" Vim syntax file +" Language: rosmsg +" Maintainer: Sergey Alexandrov +" Filenames: *.msg + +if exists("b:current_syntax") + finish +endif + +syn keyword rosmsgBuiltInType bool +syn keyword rosmsgBuiltInType int8 +syn keyword rosmsgBuiltInType uint8 +syn keyword rosmsgBuiltInType int16 +syn keyword rosmsgBuiltInType uint16 +syn keyword rosmsgBuiltInType int32 +syn keyword rosmsgBuiltInType uint32 +syn keyword rosmsgBuiltInType int64 +syn keyword rosmsgBuiltInType uint64 +syn keyword rosmsgBuiltInType float32 +syn keyword rosmsgBuiltInType float64 +syn keyword rosmsgBuiltInType string +syn keyword rosmsgBuiltInType time +syn keyword rosmsgBuiltInType duration +syn keyword rosmsgBuiltInType Header + +syn match rosmsgType "\v^\h\w+(/\h\w+)=" nextgroup=rosmsgArray,rosmsgField,rosmsgConstant +syn match rosmsgArray "\[\d*\]" +syn match rosmsgField "\v\s+\h\w*(\w*\s*\=)@!" +syn match rosmsgConstant "\v\s+\u[0-9A-Z_]*(\s*\=)@=" +syn match rosmsgComment "\v#.*$" + +hi def link rosmsgBuiltInType Keyword +hi def link rosmsgType Type +hi def link rosmsgArray Normal +hi def link rosmsgField Identifier +hi def link rosmsgConstant Constant +hi def link rosmsgComment Comment + +let b:current_syntax = "rosmsg"