-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgift.vim
45 lines (37 loc) · 1.77 KB
/
gift.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
" Vim syntax file
" Language: Moodle GIFT (General Import Format Template)
" Maintainer: Clinton McKay
" Latest Revision: 21 February 2015
if exists("b:current_syntax")
finish
endif
let conceallevel = 1
"------------------------------------------------------------------------/
" GIFT Comments
"------------------------------------------------------------------------/
syn keyword giftTodo containedin=giftComment contained TODO FIXME XXX NOTE
syn match giftComment "\/\/.*$" contains=giftTodo
syn match giftFormat "\[.\{-}\]" conceal cchar=⥊ containedin=giftProblem
syn match giftTitle /^::.\{-}::/ containedin=giftProblem
"------------------------------------------------------------------------/
" GIFT blocks
"------------------------------------------------------------------------/
syn region giftProblem start=/^::/hs=s+1 end=/}/ skip='\\}' keepend contains=giftAnswers
syn region giftAnswers start='{' end=/}/he=e-1 skip='\\}' keepend concealends
\ containedin=giftProblem contains=giftFormat
syn region giftCorrect start='=' end=/\(\s*\)\+[~]/he=e-1 skip='\\\~|\\\='
\ containedin=giftAnswers contains=giftFormat
syn region giftIncorrect start='[~]' end=/\(\s*\)\+[=]/he=e-1 skip='\\\~|\\\='
\ containedin=giftAnswers contains=giftFormat
"------------------------------------------------------------------------/
" Setup syntax highlighting
"------------------------------------------------------------------------/
let b:current_syntax = "gift"
hi def link giftComment Comment
hi def link giftTodo Todo
hi def link giftTitle Title
hi def link giftAnswers MoreMsg
hi def link giftProblem ModeMsg
hi def link giftCorrect Identifier
hi def link giftIncorrect Constant
hi def link giftFormat LineNr