vis

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

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

commit 6789e9f2c56bcaebfc62956d84dece8daf891bd1
parent 5fe744f76cf72ec34500b90533186a3ceffa3450
Author: Christian Hesse <mail@eworm.de>
Date:   Thu,  2 Feb 2017 09:22:42 +0100

add /etc/vis to lua path for system-wide configuration by administrator

Diffstat:
Mman/vis.1 | 8+++++++-
Mvis-lua.c | 3+++
2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/man/vis.1 b/man/vis.1 @@ -1242,7 +1242,10 @@ Upon startup .Nm will source the first .Pa visrc.lua -configuration file found from these locations: +configuration file found from these locations. All actively used paths can +be listed at runtime using the +.Cm :help +command. .Bl -bullet .It .Pa $VIS_PATH @@ -1261,6 +1264,9 @@ refers to if unset. . .It +.Pa /etc/vis +for a system-wide configuration provided by administrator. +.It .Pa /usr/local/share/vis or .Pa /usr/share/vis diff --git a/vis-lua.c b/vis-lua.c @@ -2186,6 +2186,7 @@ void vis_lua_init(Vis *vis) { * - $VIS_PATH/{,lexers} * - {,lexers} relative to the binary location * - $XDG_CONFIG_HOME/vis/{,lexers} (defaulting to $HOME/.config/vis/{,lexers}) + * - /etc/vis/{,lexers} (for system-wide configuration provided by administrator) * - /usr/local/share/vis/{,lexers} (or whatever is specified during ./configure) * - package.path (standard lua search path) */ @@ -2201,6 +2202,8 @@ void vis_lua_init(Vis *vis) { home = pw->pw_dir; } + vis_lua_path_add(vis, "/etc/vis"); + const char *xdg_config = getenv("XDG_CONFIG_HOME"); if (xdg_config) { snprintf(path, sizeof path, "%s/vis", xdg_config);