## Index
- [Introduction](#introduction)
+- [Wiki, resources](#wiki-resources)
- [Features](#features)
- [Quickstart](#quickstart)
- [Installation](#installation)
It runs smoothly on the Raspberry Pi, Termux on Android, Linux, macOS, BSD, Cygwin and Linux subsystem for Windows. `nnn` works seamlessly with DEs and GUI utilities.
-#### Important links
+## Wiki, resources
-1. [Wiki](https://github.com/jarun/nnn/wiki): operational concepts, how tos, use cases, chronology and insights
+1. [Wiki](https://github.com/jarun/nnn/wiki) (concepts, how-tos, use cases, chronology and insights)
2. [Performance numbers](https://github.com/jarun/nnn/wiki/Performance)
3. [Plugin repository and docs](https://github.com/jarun/nnn/tree/master/plugins)
4. [(neo)vim plugin](https://github.com/mcchrish/nnn.vim)
#define VISUAL 1
#define EDITOR 2
#define PAGER 3
+#define NCUR 4
static const char * const envs[] = {
"SHELL",
"VISUAL",
"EDITOR",
"PAGER",
+ "NN",
};
/* Event handling */
return retstatus;
}
+static void prompt_run(char *cmd, const char *cur, const char *path)
+{
+ setenv(envs[NCUR], cur, 1);
+ spawn(shell, "-c", cmd, path, F_CLI | F_CMD);
+}
+
/* Get program name from env var, else return fallback program */
static char *xgetenv(const char *name, char *fallback)
{
/* If there's a filter, try a command on ^P */
if (cfg.filtercmd && *ch == CONTROL('P') && len > 1) {
- spawn(shell, "-c", pln, path, F_CLI | F_CMD);
+ prompt_run(pln, (ndents ? dents[cur].name : ""), path);
continue;
}
goto nochange;
break;
case SEL_SHELL:
+ setenv(envs[NCUR], (ndents ? dents[cur].name : ""), 1);
spawn(shell, NULL, NULL, path, F_CLI);
break;
case SEL_PLUGKEY: // fallthrough
}
#endif
if (tmp && tmp[0]) // NOLINT
- spawn(shell, "-c", tmp, path, F_CLI | F_CMD);
+ prompt_run(tmp, (ndents ? dents[cur].name : ""), path);
}
/* Continue in navigate-as-you-type mode, if enabled */