From 1c5108895a47f8fec51477669720e643a7e4a41a Mon Sep 17 00:00:00 2001 From: Marcel Rodrigues Date: Sat, 4 Apr 2015 12:24:28 -0300 Subject: [PATCH] Add basic Lua syntax highlighting support --- config.def.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/config.def.h b/config.def.h index 48feb08..28153aa 100644 --- 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 = {{ -- 2.2.0