vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 0c4fdf9298b44ba76f684a7d34085488850126e4
parent 3aaf56e28c99e20f4f3458bfdece2e1a3a5fe208
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Mon, 22 Sep 2014 05:45:34 +0200

Make syntax highlighting run time configurable

 :set syntax name

Diffstat:
Mvis.c | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/vis.c b/vis.c @@ -1010,6 +1010,15 @@ static bool cmd_set(const char *argv[]) { editor_info_show(vis, "Expecting: set expandtab [0|1]"); return false; } + } else if (!strcmp("syntax", argv[1])) { + for (Syntax *syntax = syntaxes; syntax && syntax->name; syntax++) { + if (!strcmp(syntax->name, argv[2])) { + window_syntax_set(vis->win->win, syntax); + return true; + } + } + window_syntax_set(vis->win->win, NULL); + return false; } else { editor_info_show(vis, "Unknown option: `%s'", argv[1]); return false;