1 " Copyright 2015 The Chromium Authors. All rights reserved.
2 " Use of this source code is governed by a BSD-style license that can be
3 " found in the LICENSE file.
5 " Vim syntax file " Language: Mojom
6 " To get syntax highlighting for .mojom files, add the following to your .vimrc
8 " set runtimepath^=/path/to/src/tools/vim/mojom
12 syntax region mojomFold start="{" end="}" transparent fold
15 syntax keyword mojomType bool int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double array
16 syntax match mojomImport "^\(import\)\s"
17 syntax keyword mojomKeyword const module interface enum struct union
18 syntax match mojomOperator /=>/
19 syntax match mojomOperator /?/
22 syntax keyword mojomTodo contained TODO FIXME XXX
23 syntax region mojomComment start="/\*" end="\*/" contains=mojomTodo,mojomDocLink,@Spell
24 syntax match mojomLineComment "//.*" contains=mojomTodo,@Spell
25 syntax match mojomLineDocComment "///.*" contains=mojomTodo,mojomDocLink,@Spell
26 syntax region mojomDocLink contained start=+\[+ end=+\]+
29 syn region mojomString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
30 hi def link mojomString String
32 " The default highlighting.
33 highlight default link mojomTodo Todo
34 highlight default link mojomComment Comment
35 highlight default link mojomLineComment Comment
36 highlight default link mojomLineDocComment Comment
37 highlight default link mojomDocLink SpecialComment
38 highlight default link mojomType Type
39 highlight default link mojomImport Include
40 highlight default link mojomKeyword Keyword
41 highlight default link mojomOperator Operator
43 let b:current_syntax = "mojom"
44 let b:spell_options = "contained"
48 let b:current_syntax = "mojom"