robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
34b4df774d
master
1" Language: Vim Tutor 2" Maintainer: Vim Project 3" Last Change: 2025 Apr 16 4 5if exists ( "b:current_syntax" ) 6finish 7endif 8 9let s: cpo_save = & cpo 10set cpo & vim 11 12syn include @VIM syntax/vim.vim 13unlet b: current_syntax 14syn include @TUTORSHELL syntax/sh.vim 15unlet b: current_syntax 16syn include @VIMNORMAL syntax/vimnormal.vim 17 18syn iskeyword @,-,_,48-57 19 20syn match tutorLink /\[.\{-}\](.\{-}) /contains = tutorInlineNormal 21syn match tutorLinkBands /\[\|\]\|(\|) /contained containedin = tutorLink , tutorLinkAnchor conceal 22syn match tutorLinkAnchor /(.\{-}) /contained containedin = tutorLink conceal 23syn match tutorURL /\(https\?\|file\):\/\/ [ [:graph: ] ]\+\>\/\? / 24syn match tutorEmail /\< [ [:graph: ] ]\+@ [ [:graph: ] ]\+\> / 25syn match tutorInternalAnchor /\* [ [:alnum: ] -]\+\* /contained conceal containedin = tutorSection 26 27syn match tutorSection /^#\{1,6}\s.\+$ /fold contains = tutorInlineNormal 28syn match tutorSectionBullet /# /contained containedin = tutorSection 29 30syn match tutorTOC /\ctable of contents: / 31 32syn match tutorConcealedEscapes /\\ [ `*!\[\]():$- ] \@= /conceal 33 34syn region tutorEmphasis matchgroup = Delimiter start = /[ \* ] \@<!\*\*\@! /end = /[ \* ] \@<!\*\*\@! / 35 \concealends contains = tutorInlineCommand , tutorInlineNormal 36syn region tutorBold matchgroup = Delimiter start = /\*\{2} /end = /\*\{2} / 37 \concealends contains = tutorInlineCommand , tutorInlineNormal 38 39syn keyword tutorMarks TODO NOTE IMPORTANT TIP ATTENTION EXERCISE 40syn keyword tutorMarks todo note tip attention exercise 41syn keyword tutorMarks Todo Note Tip Excersise 42 43syn region tutorCodeblock matchgroup = Delimiter start = /^\~\{3}. * $ /end = /^\~\{3} / 44 45syn region tutorShell matchgroup = Delimiter start = /^\~\{3} sh\s * $ /end = /^\~\{3} /keepend contains = @TUTORSHELL concealends 46syn match tutorShellPrompt /\(^\s * \)\@<= [ $# ] /contained containedin = tutorShell 47 48syn region tutorInlineCode matchgroup = Delimiter start = /\\\@<!` /end = /\\\@<!\(`{\@!\|`\s\) /concealends 49 50syn region tutorCommand matchgroup = Delimiter start = /^\~\{3} cmd\( :\)\?\s * $ /end = /^\~\{3} /keepend contains = @VIM concealends 51syn region tutorInlineCommand matchgroup = Delimiter start = /\\\@<!`\(. * `{vim}\)\@= /end = /\\\@<!`\({vim}\)\@= /nextgroup = tutorInlineType contains = @VIM concealends keepend 52 53syn region tutorNormal matchgroup = Delimiter start = /^\~\{3} norm\(al\?\)\?\s * $ /end = /^\~\{3} /contains = @VIMNORMAL concealends 54syn region tutorInlineNormal matchgroup = Delimiter start = /\\\@<!`\(\S * `{normal}\)\@= /end = /\\\@<!`\({normal}\)\@= /nextgroup = tutorInlineType contains = @VIMNORMAL concealends keepend 55 56syn match tutorInlineType /{\(normal\|vim\)} /contained conceal 57 58syn match tutorInlineOK /✓ / 59syn match tutorInlineX /✗ / 60 61hi def tutorLink cterm = underline gui = underline ctermfg = lightblue guifg = #0088ff 62hi def link tutorLinkBands Delimiter 63hi def link tutorLinkAnchor Underlined 64hi def link tutorInternalAnchor Underlined 65hi def link tutorURL tutorLink 66hi def link tutorEmail tutorLink 67 68hi def link tutorSection Title 69hi def link tutorSectionBullet Delimiter 70 71hi def link tutorTOC Directory 72 73hi def tutorMarks cterm = bold gui = bold 74 75hi def tutorEmphasis gui = italic cterm = italic 76hi def tutorBold gui = bold cterm = bold 77 78hi def link tutorExpect Special 79hi def tutorOK ctermfg = green guifg = #00ff88 cterm = bold gui = bold 80hi def tutorX ctermfg = red guifg = #ff2000 cterm = bold gui = bold 81hi def link tutorInlineOK tutorOK 82hi def link tutorInlineX tutorX 83 84hi def link tutorShellPrompt Delimiter 85 86let b: current_syntax = "tutor" 87let & cpo = s: cpo_save 88unlet s: cpo_save