From 4f00fdb2680cd2ce21300e234bf1c6b6333c19a4 Mon Sep 17 00:00:00 2001 From: LuoChen Date: Sat, 13 Jan 2018 00:44:28 +0800 Subject: [PATCH 1/2] feat: syntax for verbatim string, and special char --- syntax/idris.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/syntax/idris.vim b/syntax/idris.vim index fddf1ea..0f6b262 100644 --- a/syntax/idris.vim +++ b/syntax/idris.vim @@ -45,7 +45,12 @@ syn match idrisDirective "%\(access\|assert_total\|default\|elim\|error_reverse\ syn keyword idrisDSL lambda variable index_first index_next syn match idrisChar "'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'" syn match idrisBacktick "`[A-Za-z][A-Za-z0-9_']*`" -syn region idrisString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell + +syn region idrisString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell,hsSpecialChar +syn region idrisVerbatimString start=/"""/ end=/"""/ contains=@Spell fold +syn match hsSpecialChar contained "\\\([0-9]\+\|o[0-7]\+\|x[0-9a-fA-F]\+\|[\"\\'&\\abfnrtv]\|^[A-Z^_\[\\\]]\)" +syn match hsSpecialChar contained "\\\(NUL\|SOH\|STX\|ETX\|EOT\|ENQ\|ACK\|BEL\|BS\|HT\|LF\|VT\|FF\|CR\|SO\|SI\|DLE\|DC1\|DC2\|DC3\|DC4\|NAK\|SYN\|ETB\|CAN\|EM\|SUB\|ESC\|FS\|GS\|RS\|US\|SP\|DEL\)" + syn region idrisBlockComment start="{-" end="-}" contains=idrisBlockComment,idrisTodo,@Spell syn region idrisProofBlock start="\(default\s\+\)\?\(proof\|tactics\) *{" end="}" contains=idrisTactic syn match idrisIdentifier "[a-zA-Z][a-zA-z0-9_']*" contained @@ -83,7 +88,9 @@ highlight def link idrisBlockComment Comment highlight def link idrisTodo Todo highlight def link idrisMetaVar Macro highlight def link idrisString String +highlight def link idrisVerbatimString String highlight def link idrisChar String highlight def link idrisBacktick Operator +highlight def link hsSpecialChar SpecialChar let b:current_syntax = "idris" From 7a8af61b2c63bde05c180ee80bccd27e8fbd1f55 Mon Sep 17 00:00:00 2001 From: LuoChen Date: Thu, 30 May 2019 12:05:16 +0800 Subject: [PATCH 2/2] feat: syn sync --- syntax/idris.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/syntax/idris.vim b/syntax/idris.vim index 0f6b262..14ab990 100644 --- a/syntax/idris.vim +++ b/syntax/idris.vim @@ -93,4 +93,7 @@ highlight def link idrisChar String highlight def link idrisBacktick Operator highlight def link hsSpecialChar SpecialChar +syn sync ccomment idrisDocComment,idrisLineComment,idrisBlockComment minlines=100 +"syn sync fromstart + let b:current_syntax = "idris"