| atool | list and extract archives |
| vidir from moreutils | batch rename, move, delete dir entries |
| vlock (Linux) | terminal locker |
-| $EDITOR | edit files (fallback vi) |
+| $EDITOR ($VISUAL, if defined) | edit files (fallback vi) |
| $PAGER | page through files (fallback less) |
| $SHELL | spawn a shell, run script (fallback sh) |
.Pp
Pressing \fI^Y\fR again copies the paths to clipboard and exits the multi-copy mode.
.Sh ENVIRONMENT
-The SHELL, EDITOR and PAGER environment variables take precedence
+The SHELL, EDITOR (VISUAL, if defined) and PAGER environment variables take precedence
when dealing with the !, e and p commands respectively.
.Pp
\fBNNN_BMS:\fR bookmark string as \fIkey:location\fR pairs (max 10) separated by
dprintf(fd, "SHELL: %s\n", getenv("SHELL"));
if (getenv("SHLVL"))
dprintf(fd, "SHLVL: %s\n", getenv("SHLVL"));
- if (getenv("EDITOR"))
+ if (getenv("VISUAL"))
+ dprintf(fd, "VISUAL: %s\n", getenv("VISUAL"));
+ else if (getenv("EDITOR"))
dprintf(fd, "EDITOR: %s\n", getenv("EDITOR"));
if (getenv("PAGER"))
dprintf(fd, "PAGER: %s\n", getenv("PAGER"));
goto begin;
case SEL_RUNARG:
run = xgetenv(env, run);
+ if ((!run || !run[0]) && (xstrcmp("VISUAL", env) == 0))
+ run = editor ? editor : xgetenv("EDITOR", "vi");
spawn(run, dents[cur].name, NULL, path, F_NORMAL);
break;
#ifdef __linux__
#endif
/* Edit text in EDITOR, if opted */
- if (getenv("NNN_USE_EDITOR"))
- editor = xgetenv("EDITOR", "vi");
+ if (getenv("NNN_USE_EDITOR")) {
+ editor = xgetenv("VISUAL", NULL);
+ if (!editor)
+ editor = xgetenv("EDITOR", "vi");
+ }
/* Set player if not set already */
if (!player)
/* Run a custom script */
{ 'R', SEL_RUNSCRIPT, "sh", "SHELL" },
/* Run command with argument */
- { 'e', SEL_RUNARG, "vi", "EDITOR" },
+ { 'e', SEL_RUNARG, "", "VISUAL" },
{ 'p', SEL_RUNARG, "less", "PAGER" },
#ifdef __linux__
/* Lock screen */