README.md | 4 +++- src/nnn.c | 7 ++++++- diff --git a/README.md b/README.md index b4c9671c29e0f30b1eaea1a7e50e393bbb7adce6..ff608cdffefea3c927dda58769502a6eeb824a43 100644 --- a/README.md +++ b/README.md @@ -276,10 +276,10 @@ ↓ j Down PgDn ^D Scroll down ← h Parent dir ~ ` @ - HOME, /, start, last ↵ → l Open file/dir . Toggle show hidden 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 Tab ^I Next context d Toggle detail view , ^/ Leader key N LeadN Context N + / Filter/Lead Ins ^T Toggle nav-as-you-type Esc Exit prompt ^L Redraw/clear prompt ^G Quit and cd q Quit context Q ^Q Quit ? Help, config @@ -325,6 +325,8 @@ | <, , | Go to previous active context | | key | Go to bookmarked location | | ~ ` @ - | Go to HOME, `/`, start, last visited dir | | q | Quit context | + +When the filter is on, / works as an additional Leader key. #### Contexts diff --git a/src/nnn.c b/src/nnn.c index c7179d4de112db1688af4b7f55a3b218843da1ec..a03e66abb233f3805e22cf5b5de33c96e2ad8af4 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -1798,6 +1798,11 @@ goto end; redraw(path); 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 */ if (len == 1) { cur = oldcur; @@ -2808,10 +2813,10 @@ "a↓ j Down PgDn ^D Scroll down\n" "a← h Parent dir ~ ` @ - HOME, /, start, last\n" "8↵ → l Open file/dir . Toggle show hidden\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" "7Tab ^I Next context d Toggle detail view\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" "b^G Quit and cd q Quit context\n" "9Q ^Q Quit ? Help, config\n"