blob: 9efb07be8937147d0082c6eb443d79fc0d869e44 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
" Vim syntax file for conf configuration language
" Language: conf
" Maintainer: NeonXP <i@neonxp.ru>
" Latest Revision: 2025-02-23
if exists("b:current_syntax")
finish
endif
syn keyword confBoolean true false
syn keyword confTodo contained TODO FIXME XXX NOTE
" Comments
syn match confComment "#.*$" contains=confTodo
" Variables (environment variables starting with $)
syn match confVariable '\$\h\w*'
" Strings
syn region confString start='"' end='"' skip='\\"'
syn region confString start="'" end="'" skip="\\'"
syn region confMultilineString start='`' end='`' skip='\\`'
" Numbers
syn match confNumber '\d\+'
syn match confNumber '-\d\+'
syn match confFloat '\d\+\.\d\+'
syn match confFloat '-\d\+\.\d\+'
" Operators
syn match confOperator "=\ze\s*"
syn match confSemiColon ";"
" Brackets
syn match confBraces "[{}\[\]]"
" Directives (words followed by arguments and/or block)
syn match confDirective '^\s*\h\w*\ze\s*[{;]' contained
syn match confDirective '^\s*\h\w*\ze\s*\S' contained
" Keys (word followed by =)
syn match confKey '^\s*\h\w*\ze\s*='
" Define syntax groups
hi def link confComment Comment
hi def link confTodo Todo
hi def link confVariable Identifier
hi def link confString String
hi def link confMultilineString String
hi def link confNumber Number
hi def link confFloat Float
hi def link confBoolean Boolean
hi def link confOperator Operator
hi def link confSemiColon Special
hi def link confBraces Special
hi def link confKey Identifier
hi def link confDirective Function
let b:current_syntax = "conf"
|