| $PAGER | page through files (fallback less) |
| $SHELL | spawn a shell, run script (fallback sh) |
+To specify a custom file opener:
+
+ export NNN_OPENER=mimeopen
+
To edit all text files in EDITOR (preferably CLI, fallback vi):
export NNN_USE_EDITOR=1
The SHELL, EDITOR (VISUAL, if defined) and PAGER environment variables take precedence
when dealing with the !, e and p commands respectively. A single combination to arguments is supported for SHELL and PAGER.
.Pp
+\fBNNN_OPENER:\fR specify a custom file opener.
+.Bd -literal
+ export NNN_OPENER=mimeopen
+.Ed
+.Pp
\fBNNN_BMS:\fR bookmark string as \fIkey_char:location\fR pairs (max 10) separated by
\fI;\fR:
.Bd -literal
static int ndents, cur, total_dents = ENTRY_INCR;
static uint idle;
static uint idletimeout, copybufpos, copybuflen;
+static char *opener;
static char *copier;
static char *editor;
static char *pager, *pager_arg;
dprintf(fd, "\n");
}
+ if (getenv("NNN_OPENER"))
+ dprintf(fd, "NNN_OPENER: %s\n", opener);
if (cfg.useeditor)
dprintf(fd, "NNN_USE_EDITOR: 1\n");
if (getenv("NNN_CONTEXT_COLORS"))
}
/* Invoke desktop opener as last resort */
- spawn(utils[OPENER], newpath, NULL, NULL, F_NOWAIT | F_NOTRACE);
+ spawn(opener, newpath, NULL, NULL, F_NOWAIT | F_NOTRACE);
continue;
}
default:
}
#endif
+ /* Get custom opener, if set */
+ opener = getenv("NNN_OPENER");
+ if (!opener)
+ opener = utils[OPENER];
+
/* Get locker wait time, if set; copier used as tmp var */
copier = getenv("NNN_IDLE_TIMEOUT");
if (copier) {