- [zathura](https://pwmt.org/projects/zathura/) - pdf
- vim - plain text
- to add, remove recognized extensions in nnn, see [how to change file associations](#change-file-associations)
- - If a file without any extension is a plain text file, it is opened in vi
+ - If a file without any extension is a plain text file, it is opened in EDITOR (fallback vi)
- Set `NNN_FALLBACK_OPENER` as the fallback opener. E.g.:
export NNN_FALLBACK_OPENER=xdg-open
dprintf(fd, "\n\n");
close(fd);
- sprintf(buf, "cat %s | less", tmp);
+ sprintf(buf, "cat %s | %s", tmp, xgetenv("PAGER", "less"));
fd = system(buf);
unlink(tmp);
return -1;
if (full)
- sprintf(buf, "mediainfo -f \"%s\" 2>&1 | less", fpath);
+ sprintf(buf, "mediainfo -f \"%s\" 2>&1 | %s", fpath, xgetenv("PAGER", "less"));
else
- sprintf(buf, "mediainfo \"%s\" 2>&1 | less", fpath);
+ sprintf(buf, "mediainfo \"%s\" 2>&1 | %s", fpath, xgetenv("PAGER", "less"));
return system(buf);
}
static int
show_help(void)
{
- char helpstr[] = ("echo \"\
+ char helpstr[2048] = ("echo \"\
Key | Function\n\
-+-\n\
Up, k, ^P | Previous entry\n\
^L | Force a redraw\n\
? | Toggle help screen\n\
q | Quit\n\
- Q | Quit and change directory\n\n\" | less");
+ Q | Quit and change directory\n\n\" | ");
- return system(helpstr);
+ return system(strcat(helpstr, xgetenv("PAGER", "less")));
}
static int
if (strstr(cmd, "ASCII text") != NULL) {
exitcurses();
- spawn("vi", newpath, NULL, 0);
+ run = xgetenv("EDITOR", "vi");
+ spawn(run, newpath, NULL, 0);
initcurses();
continue;
} else if (fb_opener) {