plugins/README.md | 2 +-
src/nnn.c | 12 +++++++++---
diff --git a/plugins/README.md b/plugins/README.md
index 86d541c85c03b02bc84e9615ae51755ff73ede4c..54b7e4da0be3336716c966dc1160ce7d2e1d652f 100644
--- a/plugins/README.md
+++ b/plugins/README.md
@@ -45,7 +45,7 @@ | pdfread | Read a PDF or text file aloud | sh | pdftotext, mpv,
pico2wave |
| pdfview | View PDF file in `$PAGER` | sh | pdftotext/
mupdf-tools |
| picker | Pick files and list one per line (to pipe) | sh | nnn |
| pskill | Fuzzy list by name and kill process or zombie | sh | fzy, sudo/doas |
-| renamer | Batch rename files | sh | [qmv](https://www.nongnu.org/renameutils/)/[vidir](https://joeyh.name/code/moreutils/) |
+| renamer | Batch rename selection or files in dir | sh | [qmv](https://www.nongnu.org/renameutils/)/[vidir](https://joeyh.name/code/moreutils/) |
| ringtone | Create a variable bitrate mp3 ringtone from file | sh | date, ffmpeg |
| splitjoin | Split file or join selection | sh | split, cat |
| suedit | Edit file using superuser permissions | sh | sudoedit/sudo/doas |
diff --git a/src/nnn.c b/src/nnn.c
index 03ccdc8d1a92ac2c6a95856285c1665c5635c6c6..42f1e34a56c96553974cd3a931046a1207609518 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -374,6 +374,9 @@ #define UTIL_SH_EXEC 8
#define UTIL_ARCHIVEMOUNT 9
#define UTIL_SSHFS 10
#define UTIL_RCLONE 11
+#define UTIL_VI 12
+#define UTIL_LESS 13
+#define UTIL_SH 14
/* Utilities to open files, run actions */
static char * const utils[] = {
@@ -401,6 +404,9 @@ "sh -c",
"archivemount",
"sshfs",
"rclone",
+ "vi",
+ "less",
+ "sh",
};
/* Common strings */
@@ -5736,18 +5742,18 @@ if (!cfg.cliopener && xgetenv_set(env_cfg[NNN_USE_EDITOR]))
cfg.useeditor = 1;
/* Get VISUAL/EDITOR */
- enveditor = xgetenv(envs[ENV_EDITOR], "vi");
+ enveditor = xgetenv(envs[ENV_EDITOR], utils[UTIL_VI]);
editor = xgetenv(envs[ENV_VISUAL], enveditor);
DPRINTF_S(getenv(envs[ENV_VISUAL]));
DPRINTF_S(getenv(envs[ENV_EDITOR]));
DPRINTF_S(editor);
/* Get PAGER */
- pager = xgetenv(envs[ENV_PAGER], "less");
+ pager = xgetenv(envs[ENV_PAGER], utils[UTIL_LESS]);
DPRINTF_S(pager);
/* Get SHELL */
- shell = xgetenv(envs[ENV_SHELL], "sh");
+ shell = xgetenv(envs[ENV_SHELL], utils[UTIL_SH]);
DPRINTF_S(shell);
DPRINTF_S(getenv("PWD"));