mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Use common construct for utility names
This commit is contained in:
parent
0acd18f989
commit
add789c002
|
@ -45,7 +45,7 @@ Plugins extend the capabilities of `nnn`. They are _executable_ scripts (or bina
|
||||||
| pdfview | View PDF file in `$PAGER` | sh | pdftotext/<br>mupdf-tools |
|
| pdfview | View PDF file in `$PAGER` | sh | pdftotext/<br>mupdf-tools |
|
||||||
| picker | Pick files and list one per line (to pipe) | sh | nnn |
|
| 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 |
|
| 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 |
|
| ringtone | Create a variable bitrate mp3 ringtone from file | sh | date, ffmpeg |
|
||||||
| splitjoin | Split file or join selection | sh | split, cat |
|
| splitjoin | Split file or join selection | sh | split, cat |
|
||||||
| suedit | Edit file using superuser permissions | sh | sudoedit/sudo/doas |
|
| suedit | Edit file using superuser permissions | sh | sudoedit/sudo/doas |
|
||||||
|
|
12
src/nnn.c
12
src/nnn.c
|
@ -374,6 +374,9 @@ static bool g_plinit = FALSE;
|
||||||
#define UTIL_ARCHIVEMOUNT 9
|
#define UTIL_ARCHIVEMOUNT 9
|
||||||
#define UTIL_SSHFS 10
|
#define UTIL_SSHFS 10
|
||||||
#define UTIL_RCLONE 11
|
#define UTIL_RCLONE 11
|
||||||
|
#define UTIL_VI 12
|
||||||
|
#define UTIL_LESS 13
|
||||||
|
#define UTIL_SH 14
|
||||||
|
|
||||||
/* Utilities to open files, run actions */
|
/* Utilities to open files, run actions */
|
||||||
static char * const utils[] = {
|
static char * const utils[] = {
|
||||||
|
@ -401,6 +404,9 @@ static char * const utils[] = {
|
||||||
"archivemount",
|
"archivemount",
|
||||||
"sshfs",
|
"sshfs",
|
||||||
"rclone",
|
"rclone",
|
||||||
|
"vi",
|
||||||
|
"less",
|
||||||
|
"sh",
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Common strings */
|
/* Common strings */
|
||||||
|
@ -5736,18 +5742,18 @@ int main(int argc, char *argv[])
|
||||||
cfg.useeditor = 1;
|
cfg.useeditor = 1;
|
||||||
|
|
||||||
/* Get VISUAL/EDITOR */
|
/* Get VISUAL/EDITOR */
|
||||||
enveditor = xgetenv(envs[ENV_EDITOR], "vi");
|
enveditor = xgetenv(envs[ENV_EDITOR], utils[UTIL_VI]);
|
||||||
editor = xgetenv(envs[ENV_VISUAL], enveditor);
|
editor = xgetenv(envs[ENV_VISUAL], enveditor);
|
||||||
DPRINTF_S(getenv(envs[ENV_VISUAL]));
|
DPRINTF_S(getenv(envs[ENV_VISUAL]));
|
||||||
DPRINTF_S(getenv(envs[ENV_EDITOR]));
|
DPRINTF_S(getenv(envs[ENV_EDITOR]));
|
||||||
DPRINTF_S(editor);
|
DPRINTF_S(editor);
|
||||||
|
|
||||||
/* Get PAGER */
|
/* Get PAGER */
|
||||||
pager = xgetenv(envs[ENV_PAGER], "less");
|
pager = xgetenv(envs[ENV_PAGER], utils[UTIL_LESS]);
|
||||||
DPRINTF_S(pager);
|
DPRINTF_S(pager);
|
||||||
|
|
||||||
/* Get SHELL */
|
/* Get SHELL */
|
||||||
shell = xgetenv(envs[ENV_SHELL], "sh");
|
shell = xgetenv(envs[ENV_SHELL], utils[UTIL_SH]);
|
||||||
DPRINTF_S(shell);
|
DPRINTF_S(shell);
|
||||||
|
|
||||||
DPRINTF_S(getenv("PWD"));
|
DPRINTF_S(getenv("PWD"));
|
||||||
|
|
Loading…
Reference in a new issue