From 2d2278364b6186c6cdf0f0497b0498431dfe7dd1 Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Tue, 21 Dec 2021 05:56:41 +0200 Subject: Initial config --- src/highlight.zig | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/highlight.zig (limited to 'src/highlight.zig') diff --git a/src/highlight.zig b/src/highlight.zig new file mode 100644 index 0000000..b0f4cfd --- /dev/null +++ b/src/highlight.zig @@ -0,0 +1,34 @@ +pub const Highlight = enum { + none, + normal, + // Syntax highlighting + comment, + comment_ml, + keyword1, + keyword2, + number, + string, + // Other "faces" + line_no, + match, + overlong_line, + + pub fn asString(hl: Highlight) []const u8 { + return switch (hl) { + .none => "\x1b[m", + + .normal => "\x1b[39m", + + .comment => "\x1b[36m", + .comment_ml => "\x1b[36m", + .keyword1 => "\x1b[33m", + .keyword2 => "\x1b[32m", + .number => "\x1b[31m", + .string => "\x1b[35m", + + .line_no => "\x1b[0;90m", + .match => "\x1b[34m", + .overlong_line => "\x1b[91m", + }; + } +}; -- cgit v1.2.3