robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqMerge pull request #40082 from zeertzjq/vim-bcb8dacc18373d9b8

master
1.5 KiB41 linesraw
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
7if exists("b:current_syntax")
8  finish
9endif
10
11syn match sgfDelimiter "[();]"
12
13syn keyword sgfMoveProp B W nextgroup=sgfValue skipwhite
14syn keyword sgfSetupProp AB AE AW PL nextgroup=sgfValue skipwhite
15syn keyword sgfMarkupProp AR CR DD DM FG GB GW HO LB LN MA SL SQ TR UC VW nextgroup=sgfValue skipwhite
16syn keyword sgfRootProp AP CA FF GM ST SZ nextgroup=sgfValue skipwhite
17syn 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
18syn keyword sgfCommentProp C nextgroup=sgfCommentValue skipwhite
19
20syn match sgfProperty "\<[A-Za-z]\+\ze\s*\[" nextgroup=sgfValue skipwhite
21
22syn match sgfEscape "\\." contained
23syn region sgfValue contained matchgroup=sgfBracket start="\[" end="\]" skip="\\\\\|\\\]" contains=sgfEscape keepend nextgroup=sgfValue skipwhite
24syn region sgfCommentValue contained matchgroup=sgfBracket start="\[" end="\]" skip="\\\\\|\\\]" contains=sgfEscape,@Spell keepend nextgroup=sgfCommentValue skipwhite
25
26hi def link sgfDelimiter Delimiter
27hi def link sgfMoveProp Statement
28hi def link sgfSetupProp Type
29hi def link sgfMarkupProp Identifier
30hi def link sgfRootProp PreProc
31hi def link sgfGameInfoProp Label
32hi def link sgfCommentProp Comment
33hi def link sgfProperty Identifier
34hi def link sgfBracket Delimiter
35hi def link sgfEscape SpecialChar
36hi def link sgfValue String
37hi def link sgfCommentValue Comment
38
39let b:current_syntax = "sgf"
40
41" vim: ts=8