Re-format help

This commit is contained in:
Arun Prakash Jana 2017-07-03 09:46:37 +05:30
parent be8e4d8552
commit be8e9d5213
No known key found for this signature in database
GPG key ID: A75979F35C080412
4 changed files with 106 additions and 101 deletions

View file

@ -133,64 +133,65 @@ Have fun with it! PRs are welcome. Check out [#1](https://github.com/jarun/nnn/i
#### Cmdline options
usage: nnn [-l] [-i] [-p custom_nlay] [-S] [-v] [-h] [PATH]
usage: nnn [-c N] [-e] [-i] [-l] [n]
[-p nlay] [-S] [-v] [-h] [PATH]
The missing terminal file browser for X.
positional arguments:
PATH directory to open [default: current dir]
PATH directory to open [default: current dir]
optional arguments:
-c N specify dir color, disables if N>7
-e use exiftool instead of mediainfo
-i start in navigate-as-you-type mode
-l start in light mode (fewer details)
-n disable color for directory entries
-p path to custom nlay
-S start in disk usage analyzer mode
-v show program version and exit
-h show this help and exit
-c N specify dir color, disables if N>7
-e use exiftool instead of mediainfo
-i start in navigate-as-you-type mode
-l start in light mode (fewer details)
-n disable color for directory entries
-p nlay path to custom nlay
-S start in disk usage analyzer mode
-v show program version and exit
-h show this help and exit
`>` indicates the currently selected entry in `nnn`.
#### Keyboard shortcuts
```
Key | Function
-+-
Up, k, ^P | Previous entry
Down, j, ^N | Next entry
PgUp, ^U | Scroll half page up
PgDn, ^D | Scroll half page down
Home, g, ^, ^A | Jump to first entry
End, G, $, ^E | Jump to last entry
Right, Enter, l, ^M | Open file or enter dir
Left, Bksp, h, ^H | Go to parent dir
Insert | Toggle navigate-as-you-type mode
~ | Jump to HOME dir
& | Jump to initial dir
- | Jump to last visited dir
/ | Filter dir contents
^/ | Search dir in desktop search tool
. | Toggle hide .dot files
b | Show bookmark key prompt
c | Show change dir prompt
d | Toggle detail view
D | Toggle current file details screen
m | Show concise media info
M | Show full media info
s | Toggle sort by file size
S | Toggle disk usage analyzer mode
t | Toggle sort by modified time
! | Spawn SHELL in PWD (fallback sh)
e | Edit entry in EDITOR (fallback vi)
o | Open dir in NNN_DE_FILE_MANAGER
p | Open entry in PAGER (fallback less)
^K | Invoke file path copier
^L, F2 | Force a redraw, exit filter prompt
? | Toggle help and settings screen
Q | Quit and change directory
q, ^Q | Quit
Key | Function
-+-
, k, ^P | Previous entry
, j, ^N | Next entry
PgUp, ^U | Scroll half page up
PgDn, ^D | Scroll half page down
Home, g, ^, ^A | Jump to first entry
End, G, $, ^E | Jump to last entry
→, ↵, l, ^M | Open file or enter dir
, Bksp, h, ^H | Go to parent dir
Insert | Toggle navigate-as-you-type mode
~ | Jump to HOME dir
& | Jump to initial dir
- | Jump to last visited dir
/ | Filter dir contents
^/ | Search dir in desktop search tool
. | Toggle hide .dot files
b | Show bookmark key prompt
c | Show change dir prompt
d | Toggle detail view
D | Toggle current file details screen
m | Show concise media info
M | Show full media info
s | Toggle sort by file size
S | Toggle disk usage analyzer mode
t | Toggle sort by modified time
! | Spawn SHELL in PWD (fallback sh)
e | Edit entry in EDITOR (fallback vi)
o | Open dir in NNN_DE_FILE_MANAGER
p | Open entry in PAGER (fallback less)
^K | Invoke file path copier
^L, F2 | Force a redraw, unfilter
? | Toggle help and settings screen
Q | Quit and change directory
q, ^Q | Quit
```
#### Filters

View file

@ -1,7 +1,4 @@
/* See LICENSE file for copyright and license details. */
#define CWD "cwd: "
#define CURSR " > "
#define EMPTY " "
#define CONTROL(c) ((c) ^ 0x40)
/* Supported actions */

13
nnn.1
View file

@ -6,9 +6,12 @@
.Nd the missing terminal file browser for X
.Sh SYNOPSIS
.Nm
.Op Ar -l
.Op Ar -c N
.Op Ar -e
.Op Ar -i
.Op Ar -p custom_nlay
.Op Ar -l
.Op Ar -n
.Op Ar -p nlay
.Op Ar -S
.Op Ar -v
.Op Ar -h
@ -64,7 +67,7 @@ Show change dir prompt
.It Ic d
Toggle detail view
.It Ic D
Toggle current file details screen
Show current file details screen
.It Ic m
Show concise media info
.It Ic M
@ -86,7 +89,7 @@ Open current entry in PAGER (fallback less)
.It Ic ^K
Invoke file path copier
.It Ic ^L, [F2]
Force a redraw, exit filter prompt
Force a redraw, unfilter
.It Ic \&?
Toggle help and settings screen
.It Ic Q
@ -117,7 +120,7 @@ supports the following options:
.Fl n
disable color for directory entries
.Pp
.Fl "p custom_nlay"
.Fl "p nlay"
path to custom nlay
.Pp
.Fl S

98
nnn.c
View file

@ -104,6 +104,9 @@ disabledbg()
#define TOUPPER(ch) \
(((ch) >= 'a' && (ch) <= 'z') ? ((ch) - 'a' + 'A') : (ch))
#define MAX_CMD_LEN 5120
#define CWD "cwd: "
#define CURSR " > "
#define EMPTY " "
#define CURSYM(flag) (flag ? CURSR : EMPTY)
#define FILTER '/'
#define MAX_BM 10
@ -1461,41 +1464,41 @@ show_help(void)
{
char tmp[] = "/tmp/nnnXXXXXX";
static char helpstr[] = ("\
Key | Function\n\
-+-\n\
Up, k, ^P | Previous entry\n\
Down, j, ^N | Next entry\n\
PgUp, ^U | Scroll half page up\n\
PgDn, ^D | Scroll half page down\n\
Home, g, ^, ^A | Jump to first entry\n\
End, G, $, ^E | Jump to last entry\n\
Right, Enter, l, ^M | Open file or enter dir\n\
Left, Bksp, h, ^H | Go to parent dir\n\
Insert | Toggle navigate-as-you-type mode\n\
~ | Jump to HOME dir\n\
& | Jump to initial dir\n\
- | Jump to last visited dir\n\
/ | Filter dir contents\n\
^/ | Search dir in desktop search tool\n\
. | Toggle hide .dot files\n\
b | Show bookmark key prompt\n\
c | Show change dir prompt\n\
d | Toggle detail view\n\
D | Toggle current file details screen\n\
m | Show concise media info\n\
M | Show full media info\n\
s | Toggle sort by file size\n\
S | Toggle disk usage analyzer mode\n\
t | Toggle sort by modified time\n\
! | Spawn SHELL in PWD (fallback sh)\n\
e | Edit entry in EDITOR (fallback vi)\n\
o | Open dir in NNN_DE_FILE_MANAGER\n\
p | Open entry in PAGER (fallback less)\n\
^K | Invoke file path copier\n\
^L, F2 | Force a redraw, exit filter prompt\n\
? | Toggle help and settings screen\n\
Q | Quit and change directory\n\
q, ^Q | Quit\n\n\n");
Key | Function\n\
-+-\n\
, k, ^P | Previous entry\n\
, j, ^N | Next entry\n\
PgUp, ^U | Scroll half page up\n\
PgDn, ^D | Scroll half page down\n\
Home, g, ^, ^A | Jump to first entry\n\
End, G, $, ^E | Jump to last entry\n\
, , l, ^M | Open file or enter dir\n\
, Bksp, h, ^H | Go to parent dir\n\
Insert | Toggle navigate-as-you-type mode\n\
~ | Jump to HOME dir\n\
& | Jump to initial dir\n\
- | Jump to last visited dir\n\
/ | Filter dir contents\n\
^/ | Search dir in desktop search tool\n\
. | Toggle hide .dot files\n\
b | Show bookmark key prompt\n\
c | Show change dir prompt\n\
d | Toggle detail view\n\
D | Show current file details screen\n\
m | Show concise media info\n\
M | Show full media info\n\
s | Toggle sort by file size\n\
S | Toggle disk usage analyzer mode\n\
t | Toggle sort by modified time\n\
! | Spawn SHELL in PWD (fallback sh)\n\
e | Edit entry in EDITOR (fallback vi)\n\
o | Open dir in NNN_DE_FILE_MANAGER\n\
p | Open entry in PAGER (fallback less)\n\
^K | Invoke file path copier\n\
^L, F2 | Force a redraw, unfilter\n\
? | Toggle help and settings screen\n\
Q | Quit and change directory\n\
q, ^Q | Quit\n\n\n");
int i = 0, fd = mkstemp(tmp);
@ -1508,7 +1511,7 @@ show_help(void)
dprintf(fd, "BOOKMARKS\n");
for (; i < MAX_BM; ++i)
if (bookmark[i].key)
dprintf(fd, " %s: %s\n",
dprintf(fd, "\t%s: %s\n",
bookmark[i].key, bookmark[i].loc);
else
break;
@ -2452,20 +2455,21 @@ nochange:
static void
usage(void)
{
printf("usage: nnn [-l] [-i] [-p custom_nlay] [-S] [-v] [-h] [PATH]\n\n\
printf("usage: nnn [-c N] [-e] [-i] [-l] [n]\n\
[-p nlay] [-S] [-v] [-h] [PATH]\n\n\
The missing terminal file browser for X.\n\n\
positional arguments:\n\
PATH directory to open [default: current dir]\n\n\
PATH directory to open [default: current dir]\n\n\
optional arguments:\n\
-c N specify dir color, disables if N>7\n\
-e use exiftool instead of mediainfo\n\
-i start in navigate-as-you-type mode\n\
-l start in light mode (fewer details)\n\
-n disable color for directory entries\n\
-p path to custom nlay\n\
-S start in disk usage analyzer mode\n\
-v show program version and exit\n\
-h show this help and exit\n\n\
-c N specify dir color, disables if N>7\n\
-e use exiftool instead of mediainfo\n\
-i start in navigate-as-you-type mode\n\
-l start in light mode (fewer details)\n\
-n disable color for directory entries\n\
-p nlay path to custom nlay\n\
-S start in disk usage analyzer mode\n\
-v show program version and exit\n\
-h show this help and exit\n\n\
Version: %s\n\
License: BSD 2-Clause\n\
Webpage: https://github.com/jarun/nnn\n", VERSION);