sgf.vim (1585B)
1 " Vim syntax file 2 " Language: Smart Game Format 3 " Maintainer: Borys Lykah 4 " Last Change: 2026 May 30 5 6 " Quit when a syntax file was already loaded 7 if exists("b:current_syntax") 8 finish 9 endif 10 11 syn match sgfDelimiter "[();]" 12 13 syn keyword sgfMoveProp B W nextgroup=sgfValue skipwhite 14 syn keyword sgfSetupProp AB AE AW PL nextgroup=sgfValue skipwhite 15 syn keyword sgfMarkupProp AR CR DD DM FG GB GW HO LB LN MA SL SQ TR UC VW nextgroup=sgfValue skipwhite 16 syn keyword sgfRootProp AP CA FF GM ST SZ nextgroup=sgfValue skipwhite 17 syn keyword sgfGameInfoProp AN BR BT CP DT EV GC GN HA KM ON OT PB PC PW RE RO RU SO TM US WR WT nextgroup=sgfValue skipwhite 18 syn keyword sgfCommentProp C nextgroup=sgfCommentValue skipwhite 19 20 syn match sgfProperty "\<[A-Za-z]\+\ze\s*\[" nextgroup=sgfValue skipwhite 21 22 syn match sgfEscape "\\." contained 23 syn region sgfValue contained matchgroup=sgfBracket start="\[" end="\]" skip="\\\\\|\\\]" contains=sgfEscape keepend nextgroup=sgfValue skipwhite 24 syn region sgfCommentValue contained matchgroup=sgfBracket start="\[" end="\]" skip="\\\\\|\\\]" contains=sgfEscape,@Spell keepend nextgroup=sgfCommentValue skipwhite 25 26 hi def link sgfDelimiter Delimiter 27 hi def link sgfMoveProp Statement 28 hi def link sgfSetupProp Type 29 hi def link sgfMarkupProp Identifier 30 hi def link sgfRootProp PreProc 31 hi def link sgfGameInfoProp Label 32 hi def link sgfCommentProp Comment 33 hi def link sgfProperty Identifier 34 hi def link sgfBracket Delimiter 35 hi def link sgfEscape SpecialChar 36 hi def link sgfValue String 37 hi def link sgfCommentValue Comment 38 39 let b:current_syntax = "sgf" 40 41 " vim: ts=8