- Sort entries by modification time (newest to oldest)
- Spawn a shell in current directory
- Run `top`
-- Open a file with `vim` or `less`
+- Edit a file with `EDITOR` (fallback vi)
+- Page through a file in `PAGER` (fallback less)
### nnn toppings
export NNN_OPENER=gnome-open
export NNN_OPENER=gvfs-open
- Selective file associations (ignored if `NNN_OPENER` is set):
- - Associate plain text files with vim (using `file` command)
+ - Associate plain text files with vi (using `file` command)
- Remove video file associations (to each his own favourite video player)
- Associate common audio mimes with lightweight [fmedia](http://fmedia.firmdev.com/)
- Associate PDF files with [zathura](https://pwmt.org/projects/zathura/)
| `t` | toggle sort by modified time |
| `!` | spawn a shell in current dir |
| `z` | run `top` |
-| `e` | edit entry in `vim` |
-| `p` | open entry with `less` pager |
+| `e` | edit entry in `EDITOR` (fallback vi) |
+| `p` | open entry with `PAGER` (fallback less) |
| `^K` | invoke file name copier |
| `^L` | redraw window |
| `q` | quit |
### Change file associations
-If you want to set custom applications for certain mime types, or change the ones set already (e.g. vim, fmedia, zathura), modify the `assocs` structure in [config.def.h](https://github.com/jarun/nnn/blob/master/config.def.h) (it's easy). Then re-compile and install.
+If you want to set custom applications for certain mime types, or change the ones set already (e.g. vi, fmedia, zathura), modify the `assocs` structure in [config.def.h](https://github.com/jarun/nnn/blob/master/config.def.h) (it's easy). Then re-compile and install.
struct assoc assocs[] = {
//{ "\\.(avi|mp4|mkv|mp3|ogg|flac|mov)$", "mpv" },
- { "\\.(c|cpp|h|txt|log)$", "vim" },
+ { "\\.(c|cpp|h|txt|log)$", "vi" },
{ "\\.(wma|mp3|ogg|flac)$", "fmedia" },
//{ "\\.(png|jpg|gif)$", "feh" },
//{ "\\.(html|svg)$", "firefox" },
.It Ic z
Run the system top utility.
.It Ic e
-Open selected entry with the vi editor.
+Open selected entry with EDITOR (fallback vi).
.It Ic p
-Open selected entry with the less pager.
+Open selected entry with PAGER (fallback less).
.It Ic C-k
Invoke file name copier.
.It Ic C-l
.Bd -literal
-----------------------------------------------
struct assoc assocs[] = {
- { "\\.(c|cpp|h|txt|log)$", "vim" },
+ { "\\.(c|cpp|h|txt|log)$", "vi" },
{ "\\.(wma|mp3|ogg|flac)$", "fmedia" },
{ "\\.pdf$", "zathura" },
{ "\\.sh$", "sh" },
};
-----------------------------------------------
-Plain text files are opened with vim.
+Plain text files are opened with vi.
.br
Any other file types are opened with the 'xdg-open' command.
.Ed
/* Try custom applications */
bin = openwith(newpath);
- char *execvim = "vim";
+ char *execvi = "vi";
if (bin == NULL) {
/* If a custom handler application is not set, open
- plain text files with vim, then try fallback_opener */
+ plain text files with vi, then try fallback_opener */
FILE *fp;
char cmd[MAX_LEN];
int status;
pclose(fp);
if (strstr(cmd, "ASCII text") != NULL)
- bin = execvim;
+ bin = execvi;
else if (fallback_opener) {
snprintf(cmd, MAX_LEN, "%s \"%s\" > /dev/null 2>&1",
fallback_opener, newpath);