Use the term Leader key

This commit is contained in:
Arun Prakash Jana 2018-11-12 03:36:37 +05:30
parent 81380ff8d4
commit 784ed6fefe
No known key found for this signature in database
GPG key ID: A75979F35C080412
4 changed files with 12 additions and 9 deletions

View file

@ -218,7 +218,7 @@ Press <kbd>?</kbd> in `nnn` to see the list anytime.
→, ↵, l, ^M Open file/enter dir . Toggle show hidden
/ Filter Ins, ^I Toggle nav-as-you-type
b Pin current dir ^V Go to pinned dir
^B Leader key LeaderN Switch to context N
`, ^/ Leader key LeaderN Switch to context N
Esc Exit prompt ^L Redraw, clear prompt
^G Quit and cd q Quit context
Q, ^Q Quit ? Help, settings
@ -245,7 +245,7 @@ Help & settings, file details, media info and archive listing are shown in the P
#### Leader key
The Leader key <kbd>^B</kbd> provides a powerful multi-functional navigation mechanism. It is case-sensitive and understands contexts, bookmarks and handy location shortcuts.
The Leader key (<kbd>`</kbd> or <kbd>^/</kbd>) provides a powerful multi-functional navigation mechanism. It is case-sensitive and understands contexts, bookmarks and handy location shortcuts.
| Key | Function |
|:---:| --- |
@ -266,6 +266,8 @@ Contexts serve the purpose of exploring multiple directories simultaneously. 4 c
- other used contexts are underlined
- rest are unused
To switch to a context press the Leader key followed by the context number (1-4).
The first time a context is entered, it copies the state of the last visited context. Each context remembers its start directory and last visited directory.
When a context is quit, the next active context is selected. If the last active context is quit, the program quits.

8
nnn.1
View file

@ -63,7 +63,7 @@ Toggle navigate-as-you-type mode
Pin current directory
.It Ic ^V
Visit pinned directory
.It Ic ^B
.It Ic `, ^/
Leader key
.It Ic LeaderN
Switch to context N
@ -199,8 +199,8 @@ to change to the last visited directory on quit requires shell integration in a
few easy steps. Please visit the project page (linked below) for the
instructions.
.Sh CONTEXTS
Contexts (aka \fItabs\fR aka \fIworkspaces\fR) serve the purpose of exploring multiple directories
simultaneously. 4 contexts are available. The status of the contexts are shown in the top left corner:
Contexts serve the purpose of exploring multiple directories simultaneously. 4 contexts
are available. The status of the contexts are shown in the top left corner:
.Pp
- the current context is in reverse
.br
@ -208,7 +208,7 @@ simultaneously. 4 contexts are available. The status of the contexts are shown i
.br
- rest are unused
.Pp
The key prompt understands contexts. To switch contexts press \fI^B\fR and enter the context number (1-4).
To switch to a context press the Leader key followed by the context number (1-4).
.Pp
The first time a context is entered, it copies the state of the last visited context. Each context remembers its start directory and last visited directory.
.Pp

View file

@ -1371,7 +1371,7 @@ static int parsebmstr()
++bms;
/*
* Use single-char keys to use ^B like vim Leader key.
* Use single-char keys to combine with Leader key.
* Fail here to ensure keys are single char.
* To support multiple char keys remove the return
* and add appropriate check to enable smart-detect.
@ -1976,7 +1976,7 @@ static int show_help(char *path)
"4→, ↵, l, ^M Open file/enter dir . Toggle show hidden\n"
"e/ Filter Ins, ^I Toggle nav-as-you-type\n"
"eb Pin current dir ^V Go to pinned dir\n"
"d^B Leader key LeaderN Switch to context N\n"
"a`, ^/ Leader key LeaderN Switch to context N\n"
"cEsc Exit prompt ^L Redraw, clear prompt\n"
"d^G Quit and cd q Quit context\n"
"aQ, ^Q Quit ? Help, settings\n"

View file

@ -150,7 +150,8 @@ static struct key bindings[] = {
/* Last visited dir */
{ '-', SEL_CDLAST, "", "" },
/* Leader key */
{ CONTROL('B'), SEL_LEADER, "", "" },
{ CONTROL('_'), SEL_LEADER, "", "" },
{ '`', SEL_LEADER, "", "" },
/* Mark a path to visit later */
{ 'b', SEL_PIN, "", "" },
/* Visit marked directory */