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

View File

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

13
nnn.1
View File

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

98
nnn.c
View File

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