tconf.h: syntax coloring for diff & patch - neatvi - [fork] simple vi-type editor with UTF-8 support
(HTM) git clone git://src.adamsgaard.dk/neatvi
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit efd7a38d55441a6ef6c48e7056e5d55c7755fae3
(DIR) parent 1a8863660ce138e8cff1feec0cb89598f4658de9
(HTM) Author: Conny Wagenius <cjw@voidptr.se>
Date: Thu, 22 Oct 2020 10:22:58 +0200
conf.h: syntax coloring for diff & patch
Diffstat:
M conf.h | 7 +++++++
1 file changed, 7 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/conf.h b/conf.h
t@@ -17,6 +17,7 @@ static struct filetype {
{"py", "\\.py$"}, /* python */
{"bib", "bib$"}, /* refer */
{"nm", "\\.nm$"}, /* neatmail */
+ {"diff", "\\.(patch|diff)$"} /* diff */
};
/* syntax highlighting patterns */
t@@ -101,6 +102,12 @@ static struct highlight {
{"nm", {7 | SYN_IT}, "^\t.*$"},
{"nm", {SYN_BD}, "^:.*$"},
+ /* diff */
+ {"diff", {1}, "^-.*$"},
+ {"diff", {2}, "^\\+.*$"},
+ {"diff", {6}, "^@.*$"},
+ {"diff", {SYN_BD}, "^diff .*$"},
+
/* status bar */
{"---", {8 | SYN_BD, 4, 1}, "^(\".*\").*(\\[[wr]\\]).*$"},
{"---", {8 | SYN_BD, 4, 4}, "^(\".*\").*(L[0-9]+) +(C[0-9]+).*$"},