2015-05-18 19:17:39 -07:00
|
|
|
if exists("b:current_syntax")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
|
|
|
syn include @VIM syntax/vim.vim
|
|
|
|
unlet b:current_syntax
|
|
|
|
syn include @TUTORSHELL syntax/sh.vim
|
|
|
|
unlet b:current_syntax
|
|
|
|
syn include @VIMNORMAL syntax/vimnormal.vim
|
|
|
|
|
2024-03-18 04:19:20 -07:00
|
|
|
syn iskeyword @,-,_,48-57
|
|
|
|
|
2015-05-18 19:17:39 -07:00
|
|
|
syn match tutorLink /\[.\{-}\](.\{-})/ contains=tutorInlineNormal
|
|
|
|
syn match tutorLinkBands /\[\|\]\|(\|)/ contained containedin=tutorLink,tutorLinkAnchor conceal
|
|
|
|
syn match tutorLinkAnchor /(.\{-})/ contained containedin=tutorLink conceal
|
|
|
|
syn match tutorURL /\(https\?\|file\):\/\/[[:graph:]]\+\>\/\?/
|
|
|
|
syn match tutorEmail /\<[[:graph:]]\+@[[:graph:]]\+\>/
|
|
|
|
syn match tutorInternalAnchor /\*[[:alnum:]-]\+\*/ contained conceal containedin=tutorSection
|
|
|
|
|
2017-11-08 15:32:49 -07:00
|
|
|
syn match tutorSection /^#\{1,6}\s.\+$/ fold contains=tutorInlineNormal
|
2015-05-18 19:17:39 -07:00
|
|
|
syn match tutorSectionBullet /#/ contained containedin=tutorSection
|
|
|
|
|
|
|
|
syn match tutorTOC /\ctable of contents:/
|
|
|
|
|
2015-09-27 02:30:18 -07:00
|
|
|
syn match tutorConcealedEscapes /\\[`*!\[\]():$-]\@=/ conceal
|
2015-05-18 19:17:39 -07:00
|
|
|
|
|
|
|
syn region tutorEmphasis matchgroup=Delimiter start=/[\*]\@<!\*\*\@!/ end=/[\*]\@<!\*\*\@!/
|
|
|
|
\ concealends contains=tutorInlineCommand,tutorInlineNormal
|
|
|
|
syn region tutorBold matchgroup=Delimiter start=/\*\{2}/ end=/\*\{2}/
|
|
|
|
\ concealends contains=tutorInlineCommand,tutorInlineNormal
|
|
|
|
|
|
|
|
syn keyword tutorMarks TODO NOTE IMPORTANT TIP ATTENTION EXERCISE
|
|
|
|
syn keyword tutorMarks todo note tip attention exercise
|
|
|
|
syn keyword tutorMarks Todo Note Tip Excersise
|
|
|
|
|
|
|
|
syn region tutorCodeblock matchgroup=Delimiter start=/^\~\{3}.*$/ end=/^\~\{3}/
|
|
|
|
|
2020-05-08 09:48:25 -07:00
|
|
|
syn region tutorShell matchgroup=Delimiter start=/^\~\{3} sh\s*$/ end=/^\~\{3}/ keepend contains=@TUTORSHELL concealends
|
2015-05-18 19:17:39 -07:00
|
|
|
syn match tutorShellPrompt /\(^\s*\)\@<=[$#]/ contained containedin=tutorShell
|
|
|
|
|
2020-05-08 09:48:25 -07:00
|
|
|
syn region tutorInlineCode matchgroup=Delimiter start=/\\\@<!`/ end=/\\\@<!\(`{\@!\|`\s\)/ concealends
|
2015-05-18 19:17:39 -07:00
|
|
|
|
2020-05-08 09:48:25 -07:00
|
|
|
syn region tutorCommand matchgroup=Delimiter start=/^\~\{3} cmd\( :\)\?\s*$/ end=/^\~\{3}/ keepend contains=@VIM concealends
|
|
|
|
syn region tutorInlineCommand matchgroup=Delimiter start=/\\\@<!`\(.*`{vim}\)\@=/ end=/\\\@<!`\({vim}\)\@=/ nextgroup=tutorInlineType contains=@VIM concealends keepend
|
2015-05-18 19:17:39 -07:00
|
|
|
|
2020-05-08 09:48:25 -07:00
|
|
|
syn region tutorNormal matchgroup=Delimiter start=/^\~\{3} norm\(al\?\)\?\s*$/ end=/^\~\{3}/ contains=@VIMNORMAL concealends
|
|
|
|
syn region tutorInlineNormal matchgroup=Delimiter start=/\\\@<!`\(\S*`{normal}\)\@=/ end=/\\\@<!`\({normal}\)\@=/ nextgroup=tutorInlineType contains=@VIMNORMAL concealends keepend
|
2015-05-18 19:17:39 -07:00
|
|
|
|
2017-11-08 15:32:49 -07:00
|
|
|
syn match tutorInlineType /{\(normal\|vim\)}/ contained conceal
|
2015-05-18 19:17:39 -07:00
|
|
|
|
|
|
|
syn match tutorInlineOK /✓/
|
|
|
|
syn match tutorInlineX /✗/
|
|
|
|
|
2019-04-28 03:55:38 -07:00
|
|
|
hi def tutorLink cterm=underline gui=underline ctermfg=lightblue guifg=#0088ff
|
|
|
|
hi def link tutorLinkBands Delimiter
|
|
|
|
hi def link tutorLinkAnchor Underlined
|
|
|
|
hi def link tutorInternalAnchor Underlined
|
|
|
|
hi def link tutorURL tutorLink
|
|
|
|
hi def link tutorEmail tutorLink
|
2015-05-18 19:17:39 -07:00
|
|
|
|
2019-04-28 03:55:38 -07:00
|
|
|
hi def link tutorSection Title
|
|
|
|
hi def link tutorSectionBullet Delimiter
|
2015-05-18 19:17:39 -07:00
|
|
|
|
2019-04-28 03:55:38 -07:00
|
|
|
hi def link tutorTOC Directory
|
2015-05-18 19:17:39 -07:00
|
|
|
|
2019-04-28 03:55:38 -07:00
|
|
|
hi def tutorMarks cterm=bold gui=bold
|
2015-05-18 19:17:39 -07:00
|
|
|
|
2019-04-28 03:55:38 -07:00
|
|
|
hi def tutorEmphasis gui=italic cterm=italic
|
|
|
|
hi def tutorBold gui=bold cterm=bold
|
2015-05-18 19:17:39 -07:00
|
|
|
|
2019-04-28 03:55:38 -07:00
|
|
|
hi def link tutorExpect Special
|
|
|
|
hi def tutorOK ctermfg=green guifg=#00ff88 cterm=bold gui=bold
|
|
|
|
hi def tutorX ctermfg=red guifg=#ff2000 cterm=bold gui=bold
|
|
|
|
hi def link tutorInlineOK tutorOK
|
|
|
|
hi def link tutorInlineX tutorX
|
2015-05-18 19:17:39 -07:00
|
|
|
|
2019-04-28 03:55:38 -07:00
|
|
|
hi def link tutorShellPrompt Delimiter
|
2015-05-18 19:17:39 -07:00
|
|
|
|
|
|
|
let b:current_syntax = "tutor"
|