tconf.h: python syntax highlighting - 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 4c47c54d621fc83f9473c5c13a80a712c7ebcbdc
(DIR) parent f5724e9c44c13c54ff36dd080804a3c0e01877b7
(HTM) Author: Ali Gholami Rudi <ali@rudi.ir>
Date: Thu, 15 Oct 2020 17:02:48 +0330
conf.h: python syntax highlighting
Diffstat:
M conf.h | 8 ++++++++
1 file changed, 8 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/conf.h b/conf.h
t@@ -14,6 +14,7 @@ static struct filetype {
{"msg", "letter$|mbox$|mail$"}, /* email */
{"mk", "Makefile$|makefile$|\\.mk$"}, /* makefile */
{"sh", "\\.sh$"}, /* shell script */
+ {"py", "\\.py$"}, /* python */
{"nm", "\\.nm$"}, /* neatmail */
};
t@@ -71,6 +72,13 @@ static struct highlight {
{"sh", {1}, "\\$(\\{[^}]+\\}|[a-zA-Z_0-9]+)"},
{"sh", {0, SYN_BD}, "^([a-zA-Z_][a-zA-Z_0-9]*\\(\\)).*\\{"},
+ /* python */
+ {"py", {2}, "^#.*$"},
+ {"py", {5}, "\\<(and|break|class|continue|def|del|elif|else|except|finally|for|from|global)\\>"},
+ {"py", {5}, "\\<(if|import|in|is|lambda|not|or|pass|print|raise|return|try|while)\\>"},
+ {"py", {0, 0 | SYN_BD}, "([a-zA-Z][a-zA-Z0-9_]+)\\(", 1},
+ {"py", {4}, "[\"']([^\"']|\\\\\")*[\"']"},
+
/* neatmail */
{"nm", {0 | SYN_BGMK(15), 6 | SYN_BD, 12 | SYN_BD, 5, 8 | SYN_BD},
"^([ROU])([0-9]+)\t([^\t]*)\t([^\t]*)"},