plugins/.nmv | 4 ++-- plugins/README.md | 1 + src/nnn.c | 3 ++- diff --git a/plugins/.nmv b/plugins/.nmv index fe747668fc91291511b32272429a28a3382a8211..37e887de8cd291025a97a56d8818e29f40310587 100755 --- a/plugins/.nmv +++ b/plugins/.nmv @@ -19,7 +19,7 @@ # Author: KlzXS EDITOR="${EDITOR:-vi}" TMPDIR="${TMPDIR:-/tmp}" -INCLUDE_HIDDEN="${INCLUDE_HIDDEN:-0}" +NNN_INCLUDE_HIDDEN="${NNN_INCLUDE_HIDDEN:-0}" VERBOSE="${VERBOSE:-0}" RECURSIVE="${RECURSIVE:-0}" @@ -55,7 +55,7 @@ if [ "$RECURSIVE" -eq 0 ]; then findcmd="$findcmd -prune" fi - if [ "$INCLUDE_HIDDEN" -eq 0 ]; then + if [ "$NNN_INCLUDE_HIDDEN" -eq 0 ]; then findcmd="$findcmd ! -name \".*\"" fi diff --git a/plugins/README.md b/plugins/README.md index 88449c376aff0eb674446fa896ee10519fa69513..98abe93a5ba968ad4b8fdbd73d5d376364263b3c 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -209,6 +209,7 @@ 1. `$1`: The hovered file's name. 2. `$2`: The working directory (might differ from `$PWD` in case of symlinked paths; non-canonical). 3. `$3`: The picker mode output file (`-` for stdout) if `nnn` is executed as a file picker. - Sets the environment variable `NNN_PIPE` used to control `nnn` active directory. +- Sets the environment variable `NNN_INCLUDE_HIDDEN` to `1` if hidden files are active, `0` otherwise. - Exports the [special variables](https://github.com/jarun/nnn/wiki/Concepts#special-variables). Plugins can also read the `.selection` file in the config directory. diff --git a/src/nnn.c b/src/nnn.c index 6dc3bdf745904a31029ae17dd8cb6cb18d6f6998..27a8d15b867a9b7af91dabbacbbb2cd56ca3dc92 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -5130,6 +5130,7 @@ setenv(fvar, g_buf, 1); } } } + setenv("NNN_INCLUDE_HIDDEN", xitoa(cfg.showhidden), 1); } static bool run_cmd_as_plugin(const char *file, char *runfile, uchar_t flags) @@ -7269,7 +7270,7 @@ refresh = TRUE; break; case SEL_RENAMEMUL: endselection(TRUE); - setenv("INCLUDE_HIDDEN", xitoa(cfg.showhidden), 1); + setenv("NNN_INCLUDE_HIDDEN", xitoa(cfg.showhidden), 1); setenv("NNN_LIST", listpath ? listroot : "", 1); if (!(getutil(utils[UTIL_BASH])