Highlight escape sequences in strings only, empty the mimetype to have proper syntax highlighting

This commit is contained in:
Frank LENORMAND 2015-09-04 13:55:25 +03:00
parent e43a080f32
commit 2513495fd0

View File

@ -5,6 +5,7 @@
# ‾‾‾‾‾‾‾‾‾
hook global BufCreate .*\.di? %{
set buffer mimetype ""
set buffer filetype dlang
}
@ -27,9 +28,9 @@ addhl -group /dlang/token fill meta
addhl -group /dlang/disabled fill rgb:777777
addhl -group /dlang/comment fill comment
addhl -group /dlang/string regex "\\\(x[0-9a-fA-F]{2}|[0-7]{1,3}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})\>" 0:value
addhl -group /dlang/code regex %{\<(true|false|null|__FILE__|__MODULE__|__LINE__|__FUNCTION__|__PRETTY_FUNCTION__|__DATE__|__EOF__|__TIME__|__TIMESTAMP__|__VENDOR__|__VERSION__)\>|'((\\.)?|[^'\\])'} 0:value
addhl -group /dlang/code regex "-?([0-9_]*\.(?!0[xXbB]))?\<([0-9_]+|0[xX][0-9a-fA-F_]*\.?[0-9a-fA-F_]+|0[bb][01_]+)([ep]-?[0-9_]+)?[fFlLuUi]*\>" 0:value
addhl -group /dlang/code regex "\\\(x[0-9a-fA-F]{2}|[0-7]{1,3}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})\>" 0:value
addhl -group /dlang/code regex "\<(this)\>\s*[^(]" 1:value
addhl -group /dlang/code regex "\<(bool|byte|cdouble|cfloat|char|creal|dchar|double|dstring|float|idouble|ifloat|int|ireal|long|ptrdiff_t|real|size_t|short|string|ubyte|uint|ulong|ushort|void|wchar|wstring)\>" 0:type
addhl -group /dlang/code regex "\<(alias|asm|assert|body|cast|class|delegate|delete|enum|function|import|in|interface|invariant|is|lazy|mixin|module|new|out|pragma|struct|super|typeid|typeof|union|unittest|__parameters|__traits|__vector)\>" 0:keyword