From 35a18c1d980eba6c9401465901c25229552b294f Mon Sep 17 00:00:00 2001 From: Xander Swan Date: Wed, 3 Dec 2025 10:00:41 -0500 Subject: Hobby Lang syntax --- .config/nvim/syntax/hobbylang.vim | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .config/nvim/syntax/hobbylang.vim (limited to '.config/nvim/syntax/hobbylang.vim') diff --git a/.config/nvim/syntax/hobbylang.vim b/.config/nvim/syntax/hobbylang.vim new file mode 100644 index 0000000..e1953d0 --- /dev/null +++ b/.config/nvim/syntax/hobbylang.vim @@ -0,0 +1,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' -- cgit v1.3-2-g0d8e