mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Reformat program help
This commit is contained in:
parent
c5c0b7eaee
commit
ede3e0830e
87
README.md
87
README.md
|
@ -204,60 +204,39 @@ optional args:
|
||||||
|
|
||||||
#### Keyboard shortcuts
|
#### Keyboard shortcuts
|
||||||
|
|
||||||
|
Press <kbd>?</kbd> in `nnn` to see the list anytime.
|
||||||
|
|
||||||
```
|
```
|
||||||
Key Desc
|
NAVIGATION
|
||||||
----
|
↑, k, ^P Up PgUp, ^U Scroll up
|
||||||
↑, k, ^P Up
|
↓, j, ^N Down PgDn, ^D Scroll down
|
||||||
↓, j, ^N Down
|
Home, g, ^, ^A First entry ~ Go HOME
|
||||||
PgUp, ^U Scroll up
|
End, G, $, ^E Last entry & Start dir
|
||||||
PgDn, ^D Scroll down
|
←, Bksp, h, ^H Parent dir - Last visited dir
|
||||||
Home, g, ^, ^A First entry
|
→, ↵, l, ^M Open file/enter dir . Toggle show hidden
|
||||||
End, G, $, ^E Last entry
|
/ Filter Ins, ^I Toggle nav-as-you-type
|
||||||
→, ↵, l, ^M Open file/enter dir
|
b Pin current dir ^V Go to pinned dir
|
||||||
←, Bksp, h, ^H Parent dir
|
^B Key prompt ^L Redraw, clear prompt
|
||||||
^O Open with...
|
Esc Exit prompt ^Bn Switch to context n
|
||||||
Insert, ^I Toggle nav-as-you-type
|
^G Quit and cd q Quit context
|
||||||
~ Go HOME
|
Q, ^Q Quit ? Help, settings
|
||||||
& Start dir
|
FILES
|
||||||
- Last visited dir
|
^O Open with... n Create new
|
||||||
/ Filter entries
|
D File details d Toggle detail view
|
||||||
. Toggle show hidden
|
^R Rename entry r Open dir in vidir
|
||||||
^B Key prompt
|
^Y Toggle selection y List selection
|
||||||
b Pin current dir
|
⎵, ^K Copy entry path ^T Toggle path quote
|
||||||
^V Go to pinned dir
|
P Copy selection ^X Delete selection
|
||||||
d Toggle detail view
|
V Move selection X Delete entry
|
||||||
D File details
|
f Archive entry F List archive
|
||||||
m, M Brief/full media info
|
^F Extract archive m, M Brief/full media info
|
||||||
n Create new
|
e Edit in EDITOR p Open in PAGER
|
||||||
^R Rename entry
|
ORDER
|
||||||
r Open dir in vidir
|
^J Toggle du mode S Toggle apparent size
|
||||||
s Toggle sort by size
|
s Toggle sort by size t Toggle sort by mtime
|
||||||
S Toggle apparent size
|
MISC
|
||||||
^J Toggle du mode
|
o Launch GUI app !, ^] Spawn SHELL in dir
|
||||||
t Toggle sort by mtime
|
R Run custom script L Lock terminal
|
||||||
!, ^] Spawn SHELL in dir
|
|
||||||
R Run custom script
|
|
||||||
e Edit in EDITOR
|
|
||||||
p Open in PAGER
|
|
||||||
f Archive entry
|
|
||||||
F List archive
|
|
||||||
^F Extract archive
|
|
||||||
Space, ^K Copy file path
|
|
||||||
^Y Toggle selection mode
|
|
||||||
y Show copy buffer
|
|
||||||
P Copy selection
|
|
||||||
V Move selection
|
|
||||||
^X Delete selection
|
|
||||||
X Delete entry
|
|
||||||
^T Toggle path quote
|
|
||||||
^L Redraw, clear prompt
|
|
||||||
Esc Exit prompt
|
|
||||||
L Lock terminal
|
|
||||||
o Launch GUI app
|
|
||||||
? Help, settings
|
|
||||||
q Quit context
|
|
||||||
^G Quit and cd
|
|
||||||
Q, ^Q Quit
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Help & settings, file details, media info and archive listing are shown in the PAGER. Please use the PAGER-specific keys in these screens.
|
Help & settings, file details, media info and archive listing are shown in the PAGER. Please use the PAGER-specific keys in these screens.
|
||||||
|
@ -277,7 +256,7 @@ The key prompt, invoked by <kbd>^B</kbd>, provides a powerful multi-functional n
|
||||||
| <kbd>&</kbd> | Go to start directory |
|
| <kbd>&</kbd> | Go to start directory |
|
||||||
| <kbd>q</kbd> | Quit context |
|
| <kbd>q</kbd> | Quit context |
|
||||||
|
|
||||||
If all the configured bookmark keys are single character, the prompt is not shown and <kbd>Enter</kbd> is not required; just press <kbd>^B</kbd> followed by the key.
|
If all the configured bookmark keys are single character, the prompt is not shown and <kbd>Enter</kbd> is not required; just press <kbd>^B</kbd> followed by the key (like the vim Leader key).
|
||||||
|
|
||||||
#### Contexts
|
#### Contexts
|
||||||
|
|
||||||
|
|
140
nnn.1
140
nnn.1
|
@ -23,10 +23,13 @@
|
||||||
opens the current working directory by default if
|
opens the current working directory by default if
|
||||||
.Ar PATH
|
.Ar PATH
|
||||||
is not specified.
|
is not specified.
|
||||||
|
.Sh KEYBINDS
|
||||||
.Pp
|
.Pp
|
||||||
.Nm
|
.Nm
|
||||||
supports both vi-like and emacs-like key bindings as listed below.
|
supports both vi-like and emacs-like key bindings as listed below.
|
||||||
.Pp
|
.Pp
|
||||||
|
NAVIGATION
|
||||||
|
.Pp
|
||||||
.Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact
|
.Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact
|
||||||
.It Ic [Up], k, ^P
|
.It Ic [Up], k, ^P
|
||||||
Move to previous entry
|
Move to previous entry
|
||||||
|
@ -40,72 +43,67 @@ Scroll down half a page
|
||||||
Move to the first entry
|
Move to the first entry
|
||||||
.It Ic [End], G, $, ^E
|
.It Ic [End], G, $, ^E
|
||||||
Move to the last entry
|
Move to the last entry
|
||||||
|
.It Ic [Left], [Backspace], h, ^H
|
||||||
|
Go to parent directory
|
||||||
.It Ic [Right], [Enter], l, ^M
|
.It Ic [Right], [Enter], l, ^M
|
||||||
Open file or enter directory
|
Open file or enter directory
|
||||||
.It Ic [Left], [Backspace], h, ^H
|
|
||||||
Back up one directory level
|
|
||||||
.It Ic ^O
|
|
||||||
Open with a custom application
|
|
||||||
.It Ic [Insert], ^I
|
|
||||||
Toggle navigate-as-you-type mode
|
|
||||||
.It Ic ~
|
.It Ic ~
|
||||||
Change to the HOME directory
|
Change to the HOME directory
|
||||||
.It Ic &
|
.It Ic &
|
||||||
Change to initial directory
|
Change to initial directory
|
||||||
.It Ic \-
|
.It Ic \-
|
||||||
Change to the last visited directory
|
Change to the last visited directory
|
||||||
.It Ic /
|
|
||||||
Change filter (more information below)
|
|
||||||
.It Ic \&.
|
.It Ic \&.
|
||||||
Toggle show hidden . (dot) files
|
Toggle show hidden . (dot) files
|
||||||
.It Ic ^B
|
.It Ic /
|
||||||
Show key prompt (recognizes bookmark keys, ~, -, & and context IDs)
|
Change filter (more information below)
|
||||||
|
.It Ic [Insert], ^I
|
||||||
|
Toggle navigate-as-you-type mode
|
||||||
.It Ic b
|
.It Ic b
|
||||||
Pin current directory
|
Pin current directory
|
||||||
.It Ic ^V
|
.It Ic ^V
|
||||||
Visit pinned directory
|
Visit pinned directory
|
||||||
.It Ic d
|
.It Ic ^B
|
||||||
Toggle detail view
|
Show key prompt (recognizes bookmark keys, ~, -, & and context IDs)
|
||||||
.It Ic D
|
.It Ic ^L
|
||||||
Show current file details screen
|
Force a redraw, clear prompt
|
||||||
.It Ic m
|
.It Ic Esc
|
||||||
Show brief media info
|
Exit prompt
|
||||||
.It Ic M
|
.It Ic ^Bn
|
||||||
Show full media info
|
Switch to context n
|
||||||
|
.It Ic q
|
||||||
|
Quit the current context
|
||||||
|
.It Ic ^G
|
||||||
|
Quit and change directory
|
||||||
|
.It Ic Q, ^Q
|
||||||
|
Quit
|
||||||
|
.It Ic \&?
|
||||||
|
Toggle help and settings screen
|
||||||
|
.El
|
||||||
|
.Pp
|
||||||
|
FILES
|
||||||
|
.Pp
|
||||||
|
.Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact
|
||||||
|
.It Ic ^O
|
||||||
|
Open with an application
|
||||||
.It Ic n
|
.It Ic n
|
||||||
Create a new file or directory
|
Create a new file or directory
|
||||||
|
.It Ic D
|
||||||
|
Show entry details
|
||||||
|
.It Ic d
|
||||||
|
Toggle detail view
|
||||||
.It Ic ^R
|
.It Ic ^R
|
||||||
Rename selected entry
|
Rename selected entry
|
||||||
.It Ic r
|
.It Ic r
|
||||||
Open directory in vidir
|
Open directory in vidir
|
||||||
.It Ic s
|
|
||||||
Toggle sort by file size
|
|
||||||
.It Ic S
|
|
||||||
Toggle sort by apparent size
|
|
||||||
.It Ic ^J
|
|
||||||
Toggle disk usage analyzer mode
|
|
||||||
.It Ic t
|
|
||||||
Toggle sort by time modified
|
|
||||||
.It Ic \&!, ^]
|
|
||||||
Spawn SHELL in PWD (fallback sh)
|
|
||||||
.It Ic R
|
|
||||||
Run a custom script
|
|
||||||
.It Ic e
|
|
||||||
Open current entry in EDITOR (fallback vi)
|
|
||||||
.It Ic p
|
|
||||||
Open current entry in PAGER (fallback less)
|
|
||||||
.It Ic f
|
|
||||||
Archive current entry
|
|
||||||
.It Ic F
|
|
||||||
List files in archive
|
|
||||||
.It Ic ^F
|
|
||||||
Extract archive in current directory
|
|
||||||
.It Ic Space, ^K
|
|
||||||
Invoke file path copier
|
|
||||||
.It Ic ^Y
|
.It Ic ^Y
|
||||||
Toggle selection mode
|
Toggle selection mode
|
||||||
|
.It Ic Space, ^K
|
||||||
|
Copy entry absolute path
|
||||||
.It Ic y
|
.It Ic y
|
||||||
Show copy buffer
|
Show selection list
|
||||||
|
.It Ic ^T
|
||||||
|
Toggle path quote
|
||||||
.It Ic P
|
.It Ic P
|
||||||
Copy files from selection
|
Copy files from selection
|
||||||
.It Ic V
|
.It Ic V
|
||||||
|
@ -113,26 +111,45 @@ Move files from selection
|
||||||
.It Ic ^X
|
.It Ic ^X
|
||||||
Delete files from selection
|
Delete files from selection
|
||||||
.It Ic X
|
.It Ic X
|
||||||
Delete the current entry
|
Delete entry
|
||||||
, ^Q Quit
|
.It Ic f
|
||||||
.It Ic ^T
|
Archive entry
|
||||||
Toggle path quote
|
.It Ic F
|
||||||
.It Ic ^L
|
List files in archive
|
||||||
Force a redraw, clear prompt
|
.It Ic ^F
|
||||||
.It Ic Esc
|
Extract archive in current directory
|
||||||
Exit prompt
|
.It Ic m, M
|
||||||
.It Ic L
|
Show brief/full media info
|
||||||
Lock terminal (Linux only)
|
.It Ic e
|
||||||
|
Open entry in EDITOR (fallback vi)
|
||||||
|
.It Ic p
|
||||||
|
Open entry in PAGER (fallback less)
|
||||||
|
.El
|
||||||
|
.Pp
|
||||||
|
ORDER
|
||||||
|
.Pp
|
||||||
|
.Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact
|
||||||
|
.It Ic ^J
|
||||||
|
Toggle disk usage analyzer mode
|
||||||
|
.It Ic S
|
||||||
|
Toggle sort by apparent size
|
||||||
|
.It Ic s
|
||||||
|
Toggle sort by file size
|
||||||
|
.It Ic t
|
||||||
|
Toggle sort by time modified
|
||||||
|
.El
|
||||||
|
.Pp
|
||||||
|
MISC
|
||||||
|
.Pp
|
||||||
|
.Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact
|
||||||
.It Ic o
|
.It Ic o
|
||||||
Launch a GUI application
|
Launch a GUI application
|
||||||
.It Ic \&?
|
.It Ic \&!, ^]
|
||||||
Toggle help and settings screen
|
Spawn SHELL in current directory (fallback sh)
|
||||||
.It Ic q
|
.It Ic R
|
||||||
Quit the current context
|
Run a custom script
|
||||||
.It Ic ^G
|
.It Ic L
|
||||||
Quit and change directory
|
Lock terminal (Linux only)
|
||||||
.It Ic Q, ^X
|
|
||||||
Quit
|
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
Backing up one directory level will set the cursor position at the
|
Backing up one directory level will set the cursor position at the
|
||||||
|
@ -140,6 +157,7 @@ directory you came out of.
|
||||||
.Pp
|
.Pp
|
||||||
Help & settings, file details, media info and archive listing are shown in the
|
Help & settings, file details, media info and archive listing are shown in the
|
||||||
PAGER. Please use the PAGER-specific keys in these screens.
|
PAGER. Please use the PAGER-specific keys in these screens.
|
||||||
|
.Sh OPTIONS
|
||||||
.Pp
|
.Pp
|
||||||
.Nm
|
.Nm
|
||||||
supports the following options:
|
supports the following options:
|
||||||
|
|
86
src/nnn.c
86
src/nnn.c
|
@ -1960,59 +1960,37 @@ static int show_help(char *path)
|
||||||
int i = 0, fd = mkstemp(g_tmpfpath);
|
int i = 0, fd = mkstemp(g_tmpfpath);
|
||||||
char *start, *end;
|
char *start, *end;
|
||||||
static char helpstr[] = {
|
static char helpstr[] = {
|
||||||
"cKey Desc\n"
|
"0\n"
|
||||||
"e----\n"
|
"1NAVIGATION\n"
|
||||||
"7↑, k, ^P Up\n"
|
"7↑, k, ^P Up PgUp, ^U Scroll up\n"
|
||||||
"7↓, j, ^N Down\n"
|
"7↓, j, ^N Down PgDn, ^D Scroll down\n"
|
||||||
"7PgUp, ^U Scroll up\n"
|
"1Home, g, ^, ^A First entry ~ Go HOME\n"
|
||||||
"7PgDn, ^D Scroll down\n"
|
"2End, G, $, ^E Last entry & Start dir\n"
|
||||||
"1Home, g, ^, ^A First entry\n"
|
"1←, Bksp, h, ^H Parent dir - Last visited dir\n"
|
||||||
"2End, G, $, ^E Last entry\n"
|
"4→, ↵, l, ^M Open file/enter dir . Toggle show hidden\n"
|
||||||
"4→, ↵, l, ^M Open file/enter dir\n"
|
"e/ Filter Ins, ^I Toggle nav-as-you-type\n"
|
||||||
"1←, Bksp, h, ^H Parent dir\n"
|
"eb Pin current dir ^V Go to pinned dir\n"
|
||||||
"d^O Open with...\n"
|
"d^B Key prompt ^L Redraw, clear prompt\n"
|
||||||
"5Insert, ^I Toggle nav-as-you-type\n"
|
"cEsc Exit prompt ^Bn Switch to context n\n"
|
||||||
"e~ Go HOME\n"
|
"d^G Quit and cd q Quit context\n"
|
||||||
"e& Start dir\n"
|
"aQ, ^Q Quit ? Help, settings\n"
|
||||||
"e- Last visited dir\n"
|
"1FILES\n"
|
||||||
"e/ Filter entries\n"
|
"d^O Open with... n Create new\n"
|
||||||
"e. Toggle show hidden\n"
|
"eD File details d Toggle detail view\n"
|
||||||
"d^B Key prompt\n"
|
"d^R Rename entry r Open dir in vidir\n"
|
||||||
"eb Pin current dir\n"
|
"d^Y Toggle selection y List selection\n"
|
||||||
"d^V Go to pinned dir\n"
|
"a⎵, ^K Copy entry path ^T Toggle path quote\n"
|
||||||
"ed Toggle detail view\n"
|
"eP Copy selection ^X Delete selection\n"
|
||||||
"eD File details\n"
|
"eV Move selection X Delete entry\n"
|
||||||
"bm, M Brief/full media info\n"
|
"ef Archive entry F List archive\n"
|
||||||
"en Create new\n"
|
"d^F Extract archive m, M Brief/full media info\n"
|
||||||
"d^R Rename entry\n"
|
"ee Edit in EDITOR p Open in PAGER\n"
|
||||||
"er Open dir in vidir\n"
|
"1ORDER\n"
|
||||||
"es Toggle sort by size\n"
|
"d^J Toggle du mode S Toggle apparent size\n"
|
||||||
"eS Toggle apparent size\n"
|
"es Toggle sort by size t Toggle sort by mtime\n"
|
||||||
"d^J Toggle du mode\n"
|
"1MISC\n"
|
||||||
"et Toggle sort by mtime\n"
|
"eo Launch GUI app !, ^] Spawn SHELL in dir\n"
|
||||||
"a!, ^] Spawn SHELL in dir\n"
|
"eR Run custom script L Lock terminal\n"};
|
||||||
"eR Run custom script\n"
|
|
||||||
"ee Edit in EDITOR\n"
|
|
||||||
"ep Open in PAGER\n"
|
|
||||||
"ef Archive entry\n"
|
|
||||||
"eF List archive\n"
|
|
||||||
"d^F Extract archive\n"
|
|
||||||
"6Space, ^K Copy file path\n"
|
|
||||||
"d^Y Toggle selection mode\n"
|
|
||||||
"ey Show copy buffer\n"
|
|
||||||
"eP Copy selection\n"
|
|
||||||
"eV Move selection\n"
|
|
||||||
"d^X Delete selection\n"
|
|
||||||
"eX Delete entry\n"
|
|
||||||
"d^T Toggle path quote\n"
|
|
||||||
"d^L Redraw, clear prompt\n"
|
|
||||||
"cEsc Exit prompt\n"
|
|
||||||
"eL Lock terminal\n"
|
|
||||||
"eo Launch GUI app\n"
|
|
||||||
"e? Help, settings\n"
|
|
||||||
"eq Quit context\n"
|
|
||||||
"d^G Quit and cd\n"
|
|
||||||
"aQ, ^Q Quit\n\n"};
|
|
||||||
|
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -2031,7 +2009,7 @@ static int show_help(char *path)
|
||||||
start = ++end;
|
start = ++end;
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintf(fd, "\nVolume: %s of ", coolsize(get_fs_info(path, FREE)));
|
dprintf(fd, "\nVOLUME: %s of ", coolsize(get_fs_info(path, FREE)));
|
||||||
dprintf(fd, "%s free\n\n", coolsize(get_fs_info(path, CAPACITY)));
|
dprintf(fd, "%s free\n\n", coolsize(get_fs_info(path, CAPACITY)));
|
||||||
|
|
||||||
if (getenv("NNN_BMS")) {
|
if (getenv("NNN_BMS")) {
|
||||||
|
|
Loading…
Reference in a new issue