Browse Source

Support / as an additional leader key

master
Arun Prakash Jana 5 years ago
parent
commit
9431213e49
No known key found for this signature in database GPG Key ID: A75979F35C080412
2 changed files with 9 additions and 2 deletions
  1. +3
    -1
      README.md
  2. +6
    -1
      src/nnn.c

+ 3
- 1
README.md View File

@@ -276,10 +276,10 @@ Press <kbd>?</kbd> in `nnn` to see the list anytime.
← h Parent dir ~ ` @ - HOME, /, start, last ← h Parent dir ~ ` @ - HOME, /, start, last
↵ → l Open file/dir . Toggle show hidden ↵ → l Open file/dir . Toggle show hidden
Home g ^A First entry G ^E Last entry Home g ^A First entry G ^E Last entry
/ Filter Ins ^T Toggle nav-as-you-type
b Pin current dir ^B Go to pinned dir b Pin current dir ^B Go to pinned dir
Tab ^I Next context d Toggle detail view Tab ^I Next context d Toggle detail view
, ^/ Leader key N LeadN Context N , ^/ Leader key N LeadN Context N
/ Filter/Lead Ins ^T Toggle nav-as-you-type
Esc Exit prompt ^L Redraw/clear prompt Esc Exit prompt ^L Redraw/clear prompt
^G Quit and cd q Quit context ^G Quit and cd q Quit context
Q ^Q Quit ? Help, config Q ^Q Quit ? Help, config
@@ -326,6 +326,8 @@ The Leader key provides a powerful multi-functional navigation mechanism. It is
| <kbd>~</kbd> <kbd>`</kbd> <kbd>@</kbd> <kbd>-</kbd> | Go to HOME, `/`, start, last visited dir | | <kbd>~</kbd> <kbd>`</kbd> <kbd>@</kbd> <kbd>-</kbd> | Go to HOME, `/`, start, last visited dir |
| <kbd>q</kbd> | Quit context | | <kbd>q</kbd> | Quit context |


When the filter is on, <kbd>/</kbd> works as an additional Leader key.

#### Contexts #### Contexts


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: 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:


+ 6
- 1
src/nnn.c View File

@@ -1798,6 +1798,11 @@ static int filterentries(char *path)


redraw(path); redraw(path);
goto end; goto end;
case '/': /* works as Leader key in filter mode */
*ch = CONTROL('_'); // fallthrough
if (len == 1)
cur = oldcur;
goto end;
case '?': /* '?' is an invalid regex, show help instead */ case '?': /* '?' is an invalid regex, show help instead */
if (len == 1) { if (len == 1) {
cur = oldcur; cur = oldcur;
@@ -2808,10 +2813,10 @@ static bool show_help(const char *path)
"a← h Parent dir ~ ` @ - HOME, /, start, last\n" "a← h Parent dir ~ ` @ - HOME, /, start, last\n"
"8↵ → l Open file/dir . Toggle show hidden\n" "8↵ → l Open file/dir . Toggle show hidden\n"
"4Home g ^A First entry G ^E Last entry\n" "4Home g ^A First entry G ^E Last entry\n"
"c/ Filter Ins ^T Toggle nav-as-you-type\n"
"cb Pin current dir ^B Go to pinned dir\n" "cb Pin current dir ^B Go to pinned dir\n"
"7Tab ^I Next context d Toggle detail view\n" "7Tab ^I Next context d Toggle detail view\n"
"9, ^/ Leader key N LeadN Context N\n" "9, ^/ Leader key N LeadN Context N\n"
"c/ Filter/Lead Ins ^T Toggle nav-as-you-type\n"
"aEsc Exit prompt ^L Redraw/clear prompt\n" "aEsc Exit prompt ^L Redraw/clear prompt\n"
"b^G Quit and cd q Quit context\n" "b^G Quit and cd q Quit context\n"
"9Q ^Q Quit ? Help, config\n" "9Q ^Q Quit ? Help, config\n"


Loading…
Cancel
Save