syn keyword a51Instr lcall acall ret reti ajmp sjmp ljmp nop jb jnb
syn keyword a51Instr jz jnz cjne djnz
syn keyword a51Prefix cseg at db ds end
"Symbol syn match a51Symbol "[@#]" syn match a51Symbol "[()|/[/]:]"
"Label syn match a51Label "^/s*[^; /t]/+:" syn match a51Label "[$]"
" Numbers syn match a51BinaryNumber "/<[01]/+b/>" syn match a51HexNumber "/</d/x*h/>" syn match a51HexNumber "/</(0x/|$/)/x*/>" syn match a51OctalNumber "/</(0/o/+o/=/|/o/+o/)/>" syn match a51DecimalNumber "/</(0/|[1-9]/d*/)/>"
" Comment syn region a51Comment start=";" end="$" " String syn region a51String start="/"" end="/"/|$" syn region a51String start="'" end="'/|$"
"define link hi def link a51BinaryNumber a51Number hi def link a51HexNumber a51Number hi def link a51OctalNumber a51Number hi def link a51DecimalNumber a51Number
hi def link a51WorkReg a51Keyword hi def link a51SFR a51Keyword
" Colors hi a51Comment guifg=#0033FF hi a51Keyword guifg=#339933 hi a51Number guifg=#FF00FF hi a51Symbol guifg=#FF00FF hi a51String guifg=#FF00FF hi a51Instr guifg=#0000CC hi a51Label guifg=#FF0000 hi a51Prefix guifg=#9933CC
letb:current_syntax = "a51" " vim: ts=8 sw=8 :
添加方法:
将脚本复制到 Vim 目录下的 syntax 文件夹里面
添加到列表里面
修改 synmenu.vim
" The following menu items are generated by makemenu.vim. " The Start Of The Syntax Menu