tconf.h: highlight shell keywords and variables - 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 f5724e9c44c13c54ff36dd080804a3c0e01877b7
(DIR) parent e9a16a0778855b2c376333537b8331bdced600e6
(HTM) Author: Ali Gholami Rudi <ali@rudi.ir>
Date: Thu, 15 Oct 2020 16:57:19 +0330
conf.h: highlight shell keywords and variables
Diffstat:
M conf.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/conf.h b/conf.h
t@@ -63,9 +63,13 @@ static struct highlight {
{"mk", {0, SYN_BD}, "([A-Za-z_%.]+):"},
/* shell script */
+ {"sh", {5 | SYN_BD}, "\\<(break|case|continue|do|done|elif|else|esac|fi|for|if|in|then|until|while)\\>"},
{"sh", {2 | SYN_IT}, "#.*$"},
- {"sh", {4}, "\"([^\"]|\\\\\")*\""},
- {"sh", {4}, "\'[^\']*\'"},
+ {"sh", {4}, "\"([^\"\\]|\\\\.)*\""},
+ {"sh", {4}, "'[^']*'"},
+ {"sh", {4}, "`([^`\\]|\\\\.)*`"},
+ {"sh", {1}, "\\$(\\{[^}]+\\}|[a-zA-Z_0-9]+)"},
+ {"sh", {0, SYN_BD}, "^([a-zA-Z_][a-zA-Z_0-9]*\\(\\)).*\\{"},
/* neatmail */
{"nm", {0 | SYN_BGMK(15), 6 | SYN_BD, 12 | SYN_BD, 5, 8 | SYN_BD},