Makefile | 2 +- README.md | 4 ++-- config.def.h | 4 ++-- nnn.1 | 45 ++++++++++++++++++++++----------------------- diff --git a/Makefile b/Makefile index aa0dd28b1b37beb4df0c42534562a6dda4ef8c8f..ba9a9b134b035d48050a2f026b993c38eb66498c 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ nnn.o: util.h config.h strlcat.o: util.h strlcpy.o: util.h -config.h: +config.h: config.def.h cp config.def.h $@ install: all diff --git a/README.md b/README.md index ca472239d009d4b1eeda07d516ca1c1ab6f4fc3a..5037d235c87dedf455961220fc36c10019c8eb36 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ - Jump to home directory - Filter contents in current directory - Show/hide hidden files - Sort entries by modification time (newest to oldest) -- Spawn a shell in current directory +- Spawn a `SHELL` in current directory (fallback sh) - Run `top` - Edit a file with `EDITOR` (fallback vi) - Page through a file in `PAGER` (fallback less) @@ -114,7 +114,7 @@ | `d` | toggle detail view | | `.` | toggle hide dot files | | `s` | toggle sort by file size | | `t` | toggle sort by modified time | -| `!` | spawn a shell in current dir | +| `!` | spawn `SHELL` in `PWD` (fallback sh) | | `z` | run `top` | | `e` | edit entry in `EDITOR` (fallback vi) | | `p` | open entry with `PAGER` (fallback less) | diff --git a/config.def.h b/config.def.h index 8c2144cbd754c13ab7042677f2b8830a6cc7005c..bbde21a45fc11e5e2044d7200eb446dda788517d 100644 --- a/config.def.h +++ b/config.def.h @@ -12,12 +12,12 @@ char *idlecmd = "rain"; /* The screensaver program */ struct assoc assocs[] = { //{ "\\.(avi|mp4|mkv|mp3|ogg|flac|mov)$", "mpv" }, - { "\\.(c|cpp|h|txt|log)$", "vi" }, + { "\\.(c|cpp|h|txt|log|sh)$", "vi" }, { "\\.(wma|mp3|ogg|flac)$", "fmedia" }, //{ "\\.(png|jpg|gif)$", "feh" }, //{ "\\.(html|svg)$", "firefox" }, { "\\.pdf$", "zathura" }, - { "\\.sh$", "sh" }, + //{ "\\.sh$", "sh" }, //{ ".", "less" }, }; diff --git a/nnn.1 b/nnn.1 index 774d8c578b9b6ed48548e2caa0197540c8856272..5f432d75f967c3d3f45f3fc2231bb5a87ee38d1b 100644 --- a/nnn.1 +++ b/nnn.1 @@ -22,49 +22,49 @@ configuration. The default key bindings are listed below. .Pp .Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact .It Ic k, [Up] or C-p -Move to previous entry. +Move to previous entry .It Ic j, [Down] or C-n -Move to next entry. +Move to next entry .It Ic [Pgup] or C-u -Scroll up half a page. +Scroll up half a page .It Ic [Pgdown] or C-d -Scroll down half a page. +Scroll down half a page .It Ic [Home], ^ or C-a -Move to the first entry. +Move to the first entry .It Ic [End], $ or C-e -Move to the last entry. +Move to the last entry .It Ic l, [Right], [Return] or C-m -Open file or enter directory. +Open file or enter directory .It Ic h, C-h, [Left] or [Backspace] -Back up one directory level. +Back up one directory level .It Ic ~ -Change to the HOME directory. +Change to the HOME directory .It Ic / or & -Change filter (see below for more information). +Change filter (more information below) .It Ic c -Change into the given directory. +Change into the given directory .It Ic d -Toggle detail view. +Toggle detail view .It Ic \&. -Toggle hide .dot files. +Toggle hide .dot files .It Ic s -Toggle sort by file size. +Toggle sort by file size .It Ic t -Toggle sort by time modified. +Toggle sort by time modified .It Ic \&! -Spawn a shell in current directory. +Spawn SHELL in PWD (fallback sh) .It Ic z Run the system top utility. .It Ic e -Open selected entry with EDITOR (fallback vi). +Open current entry in EDITOR (fallback vi) .It Ic p -Open selected entry with PAGER (fallback less). +Open current entry in PAGER (fallback less) .It Ic C-k -Invoke file name copier. +Invoke file name copier .It Ic C-l -Force a redraw. +Force a redraw .It Ic q -Quit. +Quit .El .Pp Backing up one directory level will set the cursor position at the @@ -127,10 +127,9 @@ variable NNN_OPENER is not set: .Bd -literal ----------------------------------------------- struct assoc assocs[] = { - { "\\.(c|cpp|h|txt|log)$", "vi" }, + { "\\.(c|cpp|h|txt|log|sh)$", "vi" }, { "\\.(wma|mp3|ogg|flac)$", "fmedia" }, { "\\.pdf$", "zathura" }, - { "\\.sh$", "sh" }, }; ----------------------------------------------- Plain text files are opened with vi.