diff options
Diffstat (limited to '.config/nvim/syntax')
| -rw-r--r-- | .config/nvim/syntax/microscript.vim | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/.config/nvim/syntax/microscript.vim b/.config/nvim/syntax/microscript.vim new file mode 100644 index 0000000..e6b77f7 --- /dev/null +++ b/.config/nvim/syntax/microscript.vim @@ -0,0 +1,42 @@ +if exists("b:current_syntax") + finish +endif + +syn keyword usStatement break next ret +syn keyword usStructure let global +syn keyword usLiteral true false zilch nada +syn keyword usConditional else elseif +syn keyword usOperator and or +syn keyword usTodo TODO FIXME HACK XXX + +syn region usIfEnd transparent matchgroup=usConditional start="\<if\>" end="\<end\>" contains=TOP +syn region usRepeatEnd transparent matchgroup=usRepeat start="\<loop\>" end="\<end\>" contains=TOP +syn region usDoEnd transparent matchgroup=usStatement start="\<do\>" end="\<end\>" contains=TOP +syn region usFunEnd transparent matchgroup=usStructure start="\<fun\>" end="\<end\>" contains=TOP +syn region usString start=/"/ end=/"/ contains=usSpecial +syn region usString start=/'/ end=/'/ contains=usSpecial + +syn match usFunction /[a-zA-Z_][a-zA-Z0-9_:]*\ze(/ +syn match usLabel /<[a-zA-Z_][a-zA-Z0-9_:]*>$/ +syn match usSpecial contained /\\[\\"'tnr]/ +syn match usComment /\#.*/ contains=usTodo +syn match usNumber /\<\d\+\>/ +syn match usNumber /\<\d\+\.\d*/ +syn match usOperator /=|\+=|-=|\*=|\/=|%=||\+|-|\*|\/|%|<|>|<=|>=|==|!=|!|\.|\.\./ + +hi def link usStructure Structure +hi def link usFunction Function +hi def link usStatement Statement +hi def link usLabel Label +hi def link usConditional Conditional +hi def link usRepeat Repeat +hi def link usModifier StorageClass +hi def link usString String +hi def link usSpecial Special +hi def link usOperator Operator +hi def link usNumber Constant +hi def link usLiteral Constant +hi def link usComment Comment +hi def link usTodo Todo + +let b:current_syntax = 'microscript' |
