diff options
| author | Christian Hesse <mail@eworm.de> | 2017-02-02 09:22:42 +0100 |
|---|---|---|
| committer | Christian Hesse <mail@eworm.de> | 2017-02-02 12:35:08 +0100 |
| commit | 36b03e5d0ccee3228b19084ccb4a5e67ee06ef73 (patch) | |
| tree | 1a915d689c3c6732783c3dbfc03df63eac52ab93 | |
| parent | a8f67d43b698eab119bb611cba840e67591a4e5c (diff) | |
| download | vis-36b03e5d0ccee3228b19084ccb4a5e67ee06ef73.tar.gz vis-36b03e5d0ccee3228b19084ccb4a5e67ee06ef73.tar.xz | |
add /etc/vis to lua path for system-wide configuration by administrator
| -rw-r--r-- | man/vis.1 | 8 | ||||
| -rw-r--r-- | vis-lua.c | 3 |
2 files changed, 10 insertions, 1 deletions
@@ -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 @@ -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); |
