1
0
forked from mirror/vim-nc

new color defentions + some small aditions

This commit is contained in:
Jakub 2023-08-03 22:42:04 -04:00
parent ff36acaef2
commit 0c27bd4102

View File

@ -2,7 +2,8 @@
" Language: RS274/NGC
" Original Creator: Gary Fixler <gfixler.emc@gmail.com>
" Modifications: Greg Jurman <jurman.greg@gmail.com>
" Last Change: 2014 Apr 15
" Jakub B <jakubb.06@proton.me>
" Last Change: 2023 Aug 03
if exists("b:current_syntax")
finish
@ -18,7 +19,10 @@ syntax keyword ngcOperator EQ NE GT GE LT LE ABS ACOS ASIN ATAN COS EXP FIX FUP
syntax match ngcOperatorPunc "[%\-+*/\[\]]"
syntax match ngcFileBlock /^%$/
syntax match ngcProgramID /\(O[0-9][0-9]*\|:[0-9][0-9]*\)/
syntax match ngcIdentifier /#<*[A-Z_0-9]*>*/
syntax match ngcIdentifierDefine /#<*[A-Z_0-9]*>* *\ze=/
syntax match ngcLineNumbers /\(n[0-9][0-9]*\)/
syntax keyword ngcTodo TODO FIXME XXX contained
syntax match ngcComment /([^)]*)/ contains=ngcTodo
@ -32,52 +36,53 @@ syntax match ngcGCodes /\s*\(g[0-9][0-9]*\)/
syntax match ngcGCodesAlt /\s*\(g[0-9][0-9]*\.[0-9]\)/
syntax match ngcMCodes /\s*\(m[0-9][0-9]*\)/
syntax match ngcAxes /\s*\([abc][-#]*[0-9.][.]*[0-9]*\)/ contains=ngcIdentifier
syntax match ngcXAxisScaled /\s*\([xui] *[-+#]\?[1-9][0-9]*\)/ contains=ngcIdentifier
syntax match ngcYAxisScaled /\s*\([yvj] *[-+#]\?[1-9][0-9]*\)/ contains=ngcIdentifier
syntax match ngcZAxisScaled /\s*\([zwk] *[-+#]\?[1-9][0-9]*\)/ contains=ngcIdentifier
syntax match ngcFeedScaled /\s*\(f *#\?[1-9][0-9]*\)/ contains=ngcIdentifier
syntax match ngcXAxis /\s*\([xui] *[-+#]\?[0-9]*\.[0-9]*\)/ contains=ngcIdentifier
syntax match ngcYAxis /\s*\([yvj] *[-+#]\?[0-9]*\.[0-9]*\)/ contains=ngcIdentifier
syntax match ngcZAxis /\s*\([zwk] *[-+#]\?[0-9]*\.[0-9]*\)/ contains=ngcIdentifier
syntax match ngcFeed /\s*\([f] *[#]\?[0-9]*\.[0-9]*\)/ contains=ngcIdentifier
syntax match ngcSpecials /\s*\(,[c][#-]*[0-9.][.]*[0-9]*\|[relpqs][-#]*[0-9.][.]*[0-9]*\)\s*/ contains=ngcIdentifier
syntax match ngcTool /[hdt][0-9][0-9]*/
syntax match ngcXAxisScaled /\([xui] *[-+]\?[1-9][0-9]*\)/ contains=ngcIdentifier
syntax match ngcYAxisScaled /\([yvj] *[-+]\?[1-9][0-9]*\)/ contains=ngcIdentifier
syntax match ngcZAxisScaled /\([zwk] *[-+]\?[1-9][0-9]*\)/ contains=ngcIdentifier
syntax match ngcFeedScaled /\(f *[1-9][0-9]*\)/ contains=ngcIdentifier
syntax match ngcXAxis /\s*\([xui] *[-+#]\?[0-9]*\.*[0-9]*\)/ contains=ngcIdentifier
syntax match ngcYAxis /\s*\([yvj] *[-+#]\?[0-9]*\.*[0-9]*\)/ contains=ngcIdentifier
syntax match ngcZAxis /\s*\([zwk] *[-+#]\?[0-9]*\.*[0-9]*\)/ contains=ngcIdentifier
syntax match ngcFeed /\s*\([f] *[#]\?[0-9]*\.*[0-9]*\)/ contains=ngcIdentifier
syntax match ngcSpecials /\s*\(,[c][#-]*[0-9.][.]*[0-9]*\|[relpqs][-#]*[0-9.][.*[0-9]*\)\s*/ contains=ngcIdentifier
syntax match ngcTool /[hdt]#*[0-9][0-9]*/ contains=ngcIdentifier
syntax match ngcBlockSkip /^\/.*/
hi link ngcXAxisScaled Error
hi link ngcYAxisScaled Error
hi link ngcZAxisScaled Error
hi link ngcFeedScaled Error
highlight ngcFileBlock ctermfg=white ctermbg=red cterm=bold
highlight ngcProgramID ctermfg=white cterm=bold
highlight ngcXAxis ctermfg=darkgreen
highlight ngcYAxis ctermfg=darkblue
highlight ngcZAxis ctermfg=red
highlight ngcAxes ctermfg=lightgreen
highlight ngcSpecials ctermfg=brown
highlight ngcBlockSkip ctermfg=white cterm=bold
highlight link ngcConstant Constant
highlight link ngcConditional Conditional
highlight link ngcRepeat Repeat
highlight link ngcFunction Function
highlight link ngcOperator Operator
highlight link ngcOperatorPunc Operator
highlight link ngcIdentifier Identifier
highlight link ngcLabel Label
highlight link ngcLineNumbers LineNr
highlight link ngcTodo Todo
highlight link ngcComment Comment
highlight link ngcMessage SpecialComment
highlight link ngcLogOpen SpecialComment
highlight link ngcLogClose SpecialComment
highlight link ngcLog SpecialComment
highlight link ngcPrint SpecialComment
highlight link ngcDebug Debug
highlight link ngcGCodes Keyword
highlight link ngcGCodesAlt Keyword
highlight link ngcMCodes Keyword
highlight link ngcAxes SpecialChar
highlight ngcFeed ctermfg=magenta
highlight link ngcTool EnumeratorName
hi link ngcFileBlock ngcComment
hi link ngcProgramID Function
hi link ngcXAxis String
hi link ngcYAxis String
hi link ngcZAxis String
hi link ngcAxes Special
hi link ngcSpecials Special
hi link ngcBlockSkip GruvboxWhiteBold
hi link ngcConstant Constant
hi link ngcConditional Conditional
hi link ngcRepeat Repeat
hi link ngcFunction Function
hi link ngcOperator Operator
hi link ngcOperatorPunc Operator
hi link ngcIdentifier PreProc
hi link ngcIdentifierDefine Identifier
hi link ngcLabel Label
hi link ngcLineNumbers LineNr
hi link ngcTodo Todo
hi link ngcComment Comment
hi link ngcMessage SpecialComment
hi link ngcLogOpen SpecialComment
hi link ngcLogClose SpecialComment
hi link ngcLog SpecialComment
hi link ngcPrint SpecialComment
hi link ngcDebug Debug
hi link ngcGCodes Keyword
hi link ngcGCodesAlt Keyword
hi link ngcMCodes Keyword
hi link ngcAxes SpecialChar
hi link ngcFeed Special
hi link ngcTool Special
let b:current_syntax = "ngc"