]> git.rmz.io Git - dotfiles.git/blob - vim/syntax/rosmsg.vim
nvim: open init.lua file with <leader>en
[dotfiles.git] / vim / syntax / rosmsg.vim
1 " Vim syntax file
2 " Language: rosmsg
3 " Maintainer: Sergey Alexandrov <alexandrov88@gmail.com>
4 " Filenames: *.msg
5
6 if exists("b:current_syntax")
7 finish
8 endif
9
10 syn keyword rosmsgBuiltInType bool
11 syn keyword rosmsgBuiltInType int8
12 syn keyword rosmsgBuiltInType uint8
13 syn keyword rosmsgBuiltInType int16
14 syn keyword rosmsgBuiltInType uint16
15 syn keyword rosmsgBuiltInType int32
16 syn keyword rosmsgBuiltInType uint32
17 syn keyword rosmsgBuiltInType int64
18 syn keyword rosmsgBuiltInType uint64
19 syn keyword rosmsgBuiltInType float32
20 syn keyword rosmsgBuiltInType float64
21 syn keyword rosmsgBuiltInType string
22 syn keyword rosmsgBuiltInType time
23 syn keyword rosmsgBuiltInType duration
24 syn keyword rosmsgBuiltInType Header
25
26 syn match rosmsgType "\v^\h\w+(/\h\w+)=" nextgroup=rosmsgArray,rosmsgField,rosmsgConstant
27 syn match rosmsgArray "\[\d*\]"
28 syn match rosmsgField "\v\s+\h\w*(\w*\s*\=)@!"
29 syn match rosmsgConstant "\v\s+\u[0-9A-Z_]*(\s*\=)@="
30 syn match rosmsgComment "\v#.*$"
31
32 hi def link rosmsgBuiltInType Keyword
33 hi def link rosmsgType Type
34 hi def link rosmsgArray Normal
35 hi def link rosmsgField Identifier
36 hi def link rosmsgConstant Constant
37 hi def link rosmsgComment Comment
38
39 let b:current_syntax = "rosmsg"