vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit b9bde3c9e866588aeed70bb563753ab3b5cf1ebe
parent bffb0e631972d1326b80686249819fc0499c5180
Author: Marcel Rodrigues <marcelgmr@gmail.com>
Date:   Sat,  4 Apr 2015 12:24:28 -0300

Add basic Lua syntax highlighting support

Diffstat:
Mconfig.def.h | 45+++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+), 0 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -1031,6 +1031,51 @@ static Syntax syntaxes[] = {{ &colors[COLOR_KEYWORD2], }} },{ + .name = "lua", + .file = "\\.lua$", + .settings = (const char*[]){ + "set number", + "set autoindent", + NULL + }, + .rules = {{ + "--\\[(=*)\\[([^]]*)\\](=*)\\]", + &colors[COLOR_COMMENT], + true, + },{ + "--.*$", + &colors[COLOR_COMMENT], + },{ + "(\\[(=*)\\[([^]]*)\\](=*)\\]|^([^][]*)\\](=*)\\])", + &colors[COLOR_STRING], + true, + }, + SYNTAX_STRING, + { + B"([0-9]*\\.)?[0-9]+([eE]([\\+-])?[0-9]+)?"B, + &colors[COLOR_LITERAL], + },{ + B"0x[0-9a-fA-F]+"B, + &colors[COLOR_LITERAL], + },{ + B"(false|nil|true)"B, + &colors[COLOR_CONSTANT], + },{ + "(\\.\\.\\.)", + &colors[COLOR_CONSTANT], + },{ + B"(break|do|else|elseif|end|for|function|if|in|local|repeat|return|then|until|while)"B, + &colors[COLOR_KEYWORD], + },{ + B"(and|not|or)"B, + &colors[COLOR_OPERATOR], + },{ + "(\\+|-|\\*|/|%|\\^|#|[=~<>]=|<|>|\\.\\.)", + &colors[COLOR_OPERATOR], + }, + SYNTAX_BRACKET, + } +},{ .name = "ruby", .file = "\\.rb$", .rules = {{