Use better keys for selection mode

This commit is contained in:
Arun Prakash Jana 2019-09-29 22:59:27 +05:30
parent b046157b61
commit 17de5bfc27
No known key found for this signature in database
GPG key ID: A75979F35C080412
3 changed files with 12 additions and 10 deletions

14
nnn.1
View file

@ -131,16 +131,18 @@ auto selects the directory and enters it in this mode.
.Sh SELECTION .Sh SELECTION
Use \fI^K\fR to select the file under the cursor. Use \fI^K\fR to select the file under the cursor.
.Pp .Pp
To select multiple files the selection mode should be enabled using \fI^Y\fR. To select multiple files press \fI^Y\fR and enter selection mode.
In this mode it's possible to In this mode it's possible to
.Pp .Pp
(1) cherry-pick individual files one by one by pressing <kbd>^K</kbd> on each entry (works across directories and contexts); or, (1) cherry-pick individual files one by one by pressing \fI^K\fR on each entry (works across directories and contexts); or,
.br .br
(2) navigate to another file in the same directory to select a range of files. (2) navigate to another file in the same directory to select a range of files.
.Pp .Pp
Press \fI^Y\fR again to save the selection and exit selection mode. Running any operation that uses the selection OR pressing \fI^Y\fR again will save the selection and exit the selection mode.
.Pp .Pp
Selected files are visually indicated by a \fB+\fR before the entries. Press \fI^Y\fR twice to clear selection.
.Pp
Selected files are visually indicated by a \fI+\fR before the entries.
.br .br
The files in the list can now be listed, copied, moved, removed, archived or linked. The files in the list can now be listed, copied, moved, removed, archived or linked.
.br .br
@ -162,7 +164,7 @@ when dealing with the !, e and p commands respectively. A single combination to
.Bd -literal .Bd -literal
export NNN_PLUG='o:fzy-open;p:mocplay;d:ndiff;m:nmount;t:thumb;i:mediainf' export NNN_PLUG='o:fzy-open;p:mocplay;d:ndiff;m:nmount;t:thumb;i:mediainf'
NOTE: To run a plugin directly, press 'x' followed by the plugin key. NOTE: To run a plugin directly, press \fI:\fR followed by the plugin key.
.Ed .Ed
.Pp .Pp
\fBNNN_USE_EDITOR:\fR use VISUAL (else EDITOR, preferably CLI, fallback vi) to handle text files. \fBNNN_USE_EDITOR:\fR use VISUAL (else EDITOR, preferably CLI, fallback vi) to handle text files.
@ -201,7 +203,7 @@ when dealing with the !, e and p commands respectively. A single combination to
.Nm .Nm
may not handle keypresses correctly when used with tmux (see issue #104 for more details). Set \fBTERM=xterm-256color\fR to address it. may not handle keypresses correctly when used with tmux (see issue #104 for more details). Set \fBTERM=xterm-256color\fR to address it.
.Pp .Pp
Use the keybind \fBK\fR to toggle selection if you are having issues with \fB^Y\fR on *BSD or macOS. To use \fB^Y\fR, run: Use the keybind \fI'\fR to toggle selection if you are having issues with \fI^Y\fR on *BSD or macOS. To use \fI^Y\fR, run:
.Bd -literal .Bd -literal
stty dsusp undef stty dsusp undef
.Ed .Ed

View file

@ -2856,8 +2856,8 @@ static bool show_help(const char *path)
"1FILES\n" "1FILES\n"
"b^O Open with... n Create new/link\n" "b^O Open with... n Create new/link\n"
"cD File detail ^R F2 Rename/duplicate\n" "cD File detail ^R F2 Rename/duplicate\n"
"5⎵ ^K / Y Select entry/all r Batch rename\n" "5⎵ ^K / a Select entry/all r Batch rename\n"
"9K ^Y Toggle selection y List selection\n" "9' ^Y Toggle selection y List selection\n"
"cP Copy selection X Delete selection\n" "cP Copy selection X Delete selection\n"
"cV Move selection ^X Delete entry\n" "cV Move selection ^X Delete entry\n"
"cf Create archive C Execute entry\n" "cf Create archive C Execute entry\n"

View file

@ -198,10 +198,10 @@ static struct key bindings[] = {
{ CONTROL('K'), SEL_SEL }, { CONTROL('K'), SEL_SEL },
{ ' ', SEL_SEL }, { ' ', SEL_SEL },
/* Toggle select multiple files */ /* Toggle select multiple files */
{ 'K', SEL_SELMUL }, { '\'', SEL_SELMUL },
{ CONTROL('Y'), SEL_SELMUL }, { CONTROL('Y'), SEL_SELMUL },
/* Select all files in current dir */ /* Select all files in current dir */
{ 'Y', SEL_SELALL }, { 'a', SEL_SELALL },
/* Show list of copied files */ /* Show list of copied files */
{ 'y', SEL_SELLST }, { 'y', SEL_SELLST },
/* Copy from selection buffer */ /* Copy from selection buffer */