├── .gitignore ├── README.md └── syntax ├── 65816.vim ├── gsu.vim ├── include ├── bass.vim ├── ca65.vim ├── instr_65816.vim ├── instr_gsu.vim └── instr_spc700.vim ├── snes.vim ├── snes_bass.vim └── spc700.vim /.gitignore: -------------------------------------------------------------------------------- 1 | .*~ 2 | *~ 3 | *.swp 4 | *.tmp 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Syntax highlighting for 65816, spc700 and SuperFX assembly, for the vim text editor. 2 | 3 | ### Installing 4 | Copy /syntax into ~/.vim 5 | __or with Pathogen__ 6 | Clone this repo into your ~/.vim/bundle directory. 7 | ``` 8 | git clone https://github.com/ARM9/snes-syntax-vim.git 9 | ``` 10 | 11 | ### Using 12 | In your .vimrc: 13 | ``` 14 | au BufNewFile,BufRead *.asm,*.inc set filetype=snes 15 | ``` 16 | and/or put this line near the top or bottom of your assembly file(s): 17 | ``` 18 | ; vim: ft=name 19 | ``` 20 | Where name is one of the following: 65816, spc700, gsu (for SuperFX) and snes 21 | for all of the above for ca65, or snes_bass for bass. 22 | 23 | -------------------------------------------------------------------------------- /syntax/65816.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: 65816 assembly 3 | " Version 0.1 4 | " Maintainer: ARM9 5 | 6 | if version < 600 7 | syntax clear 8 | elseif exists("b:current_syntax") 9 | finish 10 | endif 11 | 12 | syn case ignore 13 | 14 | " so :p:h/include/bass.vim 15 | so :p:h/include/ca65.vim 16 | so :p:h/include/instr_65816.vim 17 | 18 | if version >= 508 || !exists("did_65816_syntax_inits") 19 | if version > 508 20 | command -nargs=+ HiLink hi def link 21 | else 22 | let did_65816_syntax_inits = 1 23 | command -nargs=+ HiLink hi link 24 | endif 25 | HiLink snesNumericOperator Operator 26 | HiLink snesNumbers Number 27 | 28 | HiLink snesLabel Label 29 | HiLink snesDirective Identifier 30 | " PreProc 31 | HiLink snesString String 32 | HiLink snesComment Comment 33 | HiLink snesTodo Todo 34 | 35 | HiLink asm65Reg Type 36 | HiLink asm65816Ops Function 37 | 38 | delcommand HiLink 39 | endif 40 | 41 | let b:current_syntax="65816" 42 | 43 | -------------------------------------------------------------------------------- /syntax/gsu.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: SuperFX assembly 3 | " Version 0.1 4 | " Maintainer: ARM9 5 | 6 | if version < 600 7 | syntax clear 8 | elseif exists("b:current_syntax") 9 | finish 10 | endif 11 | 12 | syn case ignore 13 | 14 | "so :p:h/include/bass.vim 15 | so :p:h/include/ca65.vim 16 | so :p:h/include/instr_gsu.vim 17 | 18 | if version >= 508 || !exists("did_gsu_syntax_inits") 19 | if version > 508 20 | command -nargs=+ HiLink hi def link 21 | else 22 | let did_gsu_syntax_inits = 1 23 | command -nargs=+ HiLink hi link 24 | endif 25 | HiLink snesNumericOperator Operator 26 | HiLink snesNumbers Number 27 | 28 | HiLink snesLabel Label 29 | HiLink snesDirective Identifier 30 | " PreProc 31 | HiLink snesString String 32 | HiLink snesComment Comment 33 | HiLink snesTodo Todo 34 | 35 | HiLink asmGsuReg Type 36 | HiLink asmGsuOps Function 37 | 38 | delcommand HiLink 39 | endif 40 | 41 | let b:current_syntax="gsu" 42 | 43 | -------------------------------------------------------------------------------- /syntax/include/bass.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: Assembler directive highlighting for bass v14 3 | " Version 0.1 4 | " Maintainer: ARM9 5 | 6 | syn keyword snesTodo contained todo fixme xxx warning danger note notice bug author date 7 | 8 | syn match snesNumericOperator "[+-/*<>=&|^!#]" 9 | 10 | syn match snesNumbers "\%(\$\x\+\|0x\x\+\|\d\+\|%[01]\+\|0b[01]\+\|0o[0-7]\+\)\>" 11 | 12 | syn match snesLabel "\<[_a-z][_a-z0-9.]*:\?" 13 | 14 | syn keyword snesDirective arch base constant db dd define defined dl dq dw else endian error evaluate fill global float32 float64 include insert macro map notice origin output print pullvar pushvar putchar scope variable warning while 15 | " todo: fix if keyword so multiline comment if 0 { works 16 | 17 | syn match snesComment "//.*$" contains=snesTodo 18 | syn region snesComment start="if 0 {" skip="//.*$" end="}" contains=snesTodo 19 | 20 | syn region snesString start="\"" skip=+\\"+ end="\"\|$" 21 | syn region snesString start="'" skip=+\\'+ end="'\|$" 22 | 23 | syn keyword asm65816Ops adc.b adc.w adc.l and.b and.w and.l asl.b asl.w bit.b bit.w 24 | syn keyword asm65816Ops cmp.b cmp.w cmp.l cpx.b cpx.w cpy.b cpy.w dec.b dec.w 25 | syn keyword asm65816Ops eor.b eor.w eor.l inc.b inc.w lda.b lda.w lda.l 26 | syn keyword asm65816Ops ldx.b ldx.w ldy.b ldy.w lsr.b lsr.w ora.b ora.w ora.l 27 | syn keyword asm65816Ops rol.b rol.w ror.b ror.w sbc.b sbc.w sbc.l 28 | syn keyword asm65816Ops sta.b sta.w sta.l stx.b stx.w sty.b sty.w stz.b stz.w 29 | syn keyword asm65816Ops trb.b tbr.w tsb.b tsb.w 30 | 31 | syn keyword asmSpc700Ops clp str 32 | 33 | -------------------------------------------------------------------------------- /syntax/include/ca65.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: Base rules for snes assembly, for ca65 and wdc816as 3 | " Version 0.1 4 | " Maintainer: ARM9 5 | 6 | setlocal iskeyword +=.,_ 7 | 8 | syn keyword snesTodo contained todo fixme xxx warning danger note notice bug author date 9 | 10 | syn match snesNumericOperator "[#+-/*<>=&|^~!?]" 11 | 12 | syn match snesNumbers "\%(\$\x[0-9a-f_]*\|\d[0-9_]*\|%[01][01_]*\|[0-9][0-9a-f_]*h\)\>" 13 | 14 | syn match snesDirective "\.\w\+\>" 15 | 16 | syn match snesLabel "\%(@\|[~_]\{0,2\}\)[a-z_]\w*:\?" 17 | 18 | syn match snesComment ";.*$" contains=snesTodo 19 | 20 | syn region snesString start="\"" skip=+\\"+ end="\"\|$" 21 | syn region snesString start="'" skip=+\\'+ end="'\|$" 22 | 23 | -------------------------------------------------------------------------------- /syntax/include/instr_65816.vim: -------------------------------------------------------------------------------- 1 | 2 | syn keyword asm65Reg x y a s 3 | 4 | syn keyword asm65816Ops adc and asl bcc bcs beq bit bmi bne bpl bra brk brl bvc bvs clc cld cli clv cmp cop cpx cpy dea dec dex dey eor ina inc inx iny jml jmp jsl jsr lda ldx ldy lsr mvn mvp nop ora pea pei per pha phb phd phk php phx phy pla plb pld plp plx ply rep rol ror rti rtl rts sbc sec sed sei sep sta stp stx sty stz swa tad tas tax tay tcd tcs tda tdc trb tsa tsb tsc tsx txa txs txy tya tyx wai wdm xba xce 5 | 6 | -------------------------------------------------------------------------------- /syntax/include/instr_gsu.vim: -------------------------------------------------------------------------------- 1 | 2 | syn keyword asmGsuOps add adc alt1 alt2 alt3 and asr bcc bcs beq bge bic blt bmi bne bpl bra bvc bvs cache cmode cmp color dec div2 fmult from getb getbh getbl getbs getc hib ibt inc iwt jal jmp ldb ldw lea link ljmp lm lms lmult lob loop lsr merge move moveb moves movew mult nop not or plot pop popb push pushb ramb ret rol romb ror rpix sbc sbk sex sm sms stb stop stw sub swap to umult with xor 3 | 4 | syn keyword asmGsuReg r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 sp lr pc 5 | 6 | -------------------------------------------------------------------------------- /syntax/include/instr_spc700.vim: -------------------------------------------------------------------------------- 1 | 2 | syn keyword asmSpc700Ops adc addw and and1 asl bbc bbs bcc bcs beq bmi bne bpl bvc bvs bra brk call cbne clr1 clrc clrp clrv cmp cmpw daa das dbnz dec decw di div ei eor eor1 inc incw jmp lsr mov mov1 movw mul nop not1 notc or or1 pcall pop push ret reti rol ror sbc set1 setc setp sleep stop subw tcall tclr1 tset1 xcn 3 | 4 | syn keyword asmSpc700Reg x y ya a s sp psw 5 | 6 | -------------------------------------------------------------------------------- /syntax/snes.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: 65816, spc700 and SuperFX assembly, for ca65, wdc816as, bass 3 | " Version 0.1 4 | " Maintainer: ARM9 5 | 6 | if version < 600 7 | syntax clear 8 | elseif exists("b:current_syntax") 9 | finish 10 | endif 11 | 12 | syn case ignore 13 | 14 | " change include to your assembler 15 | so :p:h/include/ca65.vim 16 | " so :p:h/include/bass.vim 17 | 18 | so :p:h/include/instr_65816.vim 19 | so :p:h/include/instr_spc700.vim 20 | so :p:h/include/instr_gsu.vim 21 | 22 | if version >= 508 || !exists("did_snes_syntax_inits") 23 | if version > 508 24 | command -nargs=+ HiLink hi def link 25 | else 26 | let did_snes_syntax_inits = 1 27 | command -nargs=+ HiLink hi link 28 | endif 29 | HiLink snesNumericOperator Operator 30 | HiLink snesNumbers Number 31 | 32 | HiLink snesLabel Label 33 | HiLink snesDirective Identifier 34 | " PreProc 35 | HiLink snesString String 36 | HiLink snesComment Comment 37 | HiLink snesTodo Todo 38 | 39 | HiLink asm65Reg Type 40 | HiLink asm65816Ops Function 41 | 42 | HiLink asmSpc700Reg Type 43 | HiLink asmSpc700Ops Function 44 | 45 | HiLink asmGsuReg Type 46 | HiLink asmGsuOps Function 47 | 48 | delcommand HiLink 49 | endif 50 | 51 | let b:current_syntax="snes" 52 | 53 | -------------------------------------------------------------------------------- /syntax/snes_bass.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: 65816, spc700 and SuperFX assembly, for bass 3 | " Version 0.1 4 | " Maintainer: ARM9 5 | 6 | if version < 600 7 | syntax clear 8 | elseif exists("b:current_syntax") 9 | finish 10 | endif 11 | 12 | syn case ignore 13 | 14 | so :p:h/include/bass.vim 15 | 16 | so :p:h/include/instr_65816.vim 17 | so :p:h/include/instr_spc700.vim 18 | so :p:h/include/instr_gsu.vim 19 | 20 | if version >= 508 || !exists("did_snes_bass_syntax_inits") 21 | if version > 508 22 | command -nargs=+ HiLink hi def link 23 | else 24 | let did_snes_bass_syntax_inits = 1 25 | command -nargs=+ HiLink hi link 26 | endif 27 | HiLink snesNumericOperator Operator 28 | HiLink snesNumbers Number 29 | 30 | HiLink snesLabel Label 31 | HiLink snesDirective Identifier 32 | " PreProc 33 | HiLink snesString String 34 | HiLink snesComment Comment 35 | HiLink snesTodo Todo 36 | 37 | HiLink asm65Reg Type 38 | HiLink asm65816Ops Function 39 | 40 | HiLink asmSpc700Reg Type 41 | HiLink asmSpc700Ops Function 42 | 43 | HiLink asmGsuReg Type 44 | HiLink asmGsuOps Function 45 | 46 | delcommand HiLink 47 | endif 48 | 49 | let b:current_syntax="snes_bass" 50 | 51 | -------------------------------------------------------------------------------- /syntax/spc700.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: spc700 assembly 3 | " Version 0.1 4 | " Maintainer: ARM9 5 | 6 | if version < 600 7 | syntax clear 8 | elseif exists("b:current_syntax") 9 | finish 10 | endif 11 | 12 | syn case ignore 13 | 14 | "so :p:h/include/bass.vim 15 | so :p:h/include/ca65.vim 16 | so :p:h/include/instr_spc700.vim 17 | 18 | if version >= 508 || !exists("did_spc700_syntax_inits") 19 | if version > 508 20 | command -nargs=+ HiLink hi def link 21 | else 22 | let did_spc700_syntax_inits = 1 23 | command -nargs=+ HiLink hi link 24 | endif 25 | HiLink snesNumericOperator Operator 26 | HiLink snesNumbers Number 27 | 28 | HiLink snesLabel Label 29 | HiLink snesDirective Identifier 30 | " PreProc 31 | HiLink snesString String 32 | HiLink snesComment Comment 33 | HiLink snesTodo Todo 34 | 35 | HiLink asmSpc700Reg Type 36 | HiLink asmSpc700Ops Function 37 | 38 | delcommand HiLink 39 | endif 40 | 41 | let b:current_syntax="spc700" 42 | 43 | --------------------------------------------------------------------------------