aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/syntax/hobbylang.vim
blob: e1953d0aa48fc94167ccfaa478d57cb46c4c2267 (plain)
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
if exists("b:current_syntax")
  finish
endif

syn keyword hlStatement   break continue return self
syn keyword hlLabel       case default
syn keyword hlConditional if else match
syn keyword hlRepeat      while loop for
syn keyword hlStructure   struct enum var func
syn keyword hlModifier    static
syn keyword hlLiteral     true false nil

syn match   hlFunction    /\<\h\w*\ze\_s*(/

syn match   hlComment     /\/\/.*/
syn match   hlType        /[^a-z0-9_][A-Z][A-z0-9_]*/
syn match   hlNumber      /\<\d\+\>/
syn match   hlNumber      /\<\d\+\.\d*/
syn match   hlOperator    /=|\+=|-=|\*=|\/=|%=|\*\*=|\+|-|\*\*|\*|\/|%|<|>|<=|>=|==|!=|!|\.\./

syn region  hlString      start="\"" end="\""
syn region  hlString      start="'"  end="'"

hi def link hlStructure   Structure
hi def link hlFunction    Function 
hi def link hlStatement   Statement
hi def link hlLabel       Label
hi def link hlConditional Conditional
hi def link hlRepeat      Repeat
hi def link hlModifier    StorageClass
hi def link hlType        Type
hi def link hlString      String
hi def link hlOperator    Operator
hi def link hlNumber      Constant
hi def link hlLiteral     Constant
hi def link hlComment     Comment

let b:current_syntax = 'hl'