-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathelmerror.vim
35 lines (35 loc) · 1.32 KB
/
elmerror.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
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" the very first line of the syntax message, with [elm] [...]
syn match ElmErrorType "^\[.*] "
" the line number at the beg of a line
syn match ElmLineNb "^\d*|"
" the line number with the error
syn match ElmLineWithError "^\d*|#>#.*" contains=ElmUnderlineDelim
" suggestions, surrounded by #, which should be hidden
syn match Elmsuggestion "#[^#]*#" contains=ElmUnderlineDelim
" the underline ^^^^ indicators, surrounded by #, which should be hidden
syn match ElmUnderline "#^*#" contains=ElmUnderlineDelim
syn match ElmUnderlineDelim "#" contained conceal
" identifiers, surrounded by ` (would should be hidden)
syn match ElmIdentifier "`[^`]*`" contains=ElmIdentifierDelim
syn match ElmIdentifierDelim "`" contained conceal
" hints
syn match ElmHint "^#[^#]*#" contains=ElmUnderlineDelim
" html links
syn match ElmHtml "<http.*>" contains=ElmHtmlDelim
syn match ElmHtml "http[^ ]*"
syn match ElmHtmlDelim "<" contained conceal
syn match ElmHtmlDelim ">" contained conceal
hi! def link ElmHtml Underlined
hi! def link ElmErrorType Statement
hi! def link ElmLineWithError Error
hi! def link ElmLineNb Todo
hi! def link ElmHint String
hi! def link ElmUnderline Error
hi! def link ElmSuggestion Function
hi! def link ElmIdentifier Identifier
let b:current_syntax = "elmerror"