README.md | 8 ++++---- config.def.h | 2 +- nnn.1 | 18 +++++++++--------- nnn.c | 10 +++++----- diff --git a/README.md b/README.md index f406c67c3b40925d450a6937029908e62f152ab5..b3bec46e60a7152fcbbb69b9549690466c219c2c 100644 --- a/README.md +++ b/README.md @@ -62,10 +62,10 @@ - Familiar shortcuts - Jump HOME or to the last visited directory (as usual!) - Jump to initial dir, chdir prompt, cd ..... (with . as PWD) - Roll-over at edges, page through entries - - Navigate as you type with filters + - *Navigate-as-you-type* with filters - Disk usage analyzer mode - Search - - Filter directory contents with search-as-you-type + - Filter directory contents with *search-as-you-type* - Desktop search (default gnome-search-tool, customizable) integration - Mimes - Desktop opener integration @@ -134,7 +134,7 @@ PATH directory to open [default: current dir] optional arguments: -d start in detail view mode - -f start in navigate-as-you-type mode + -i start in navigate-as-you-type mode -p path to custom nlay -S start in disk usage analyzer mode -v show program version and exit @@ -155,6 +155,7 @@ Home, g, ^, ^A | Jump to first entry End, G, $, ^E | Jump to last entry Right, Enter, l, ^M | Open file or enter dir Left, Bksp, h, ^H | Go to parent dir + Insert | Toggle navigate-as-you-type mode ~ | Jump to HOME dir & | Jump to initial dir - | Jump to last visited dir @@ -164,7 +165,6 @@ . | Toggle hide .dot files c | Show change dir prompt d | Toggle detail view D | Toggle current file details screen - f | Toggle navigate-as-you-type mode m | Show concise mediainfo M | Show full mediainfo s | Toggle sort by file size diff --git a/config.def.h b/config.def.h index 943b8f3d24e78a0b2f35712e9bdd8bac144cb9b8..52f31fda926809b9690fdc96777d4680cac4e490 100644 --- a/config.def.h +++ b/config.def.h @@ -37,7 +37,7 @@ { 'l', SEL_GOIN, "", "" }, /* Filter */ { '/', SEL_FLTR, "", "" }, /* Toggle filter mode */ - { 'f', SEL_MFLTR, "", "" }, + { KEY_IC, SEL_MFLTR, "", "" }, /* Desktop search */ { CONTROL('_'), SEL_SEARCH, "", "" }, /* Next */ diff --git a/nnn.1 b/nnn.1 index d80286d43a0d5c7713160b7bb96215b0b710de8a..d9ddfa18478aa8a9c72efc461381ad82600bae13 100644 --- a/nnn.1 +++ b/nnn.1 @@ -7,8 +7,8 @@ .Nd the missing terminal file browser for X .Sh SYNOPSIS .Nm nnn .Op Ar -d -.Op Ar -f -.Op Ar -p +.Op Ar -i +.Op Ar -p custom_nlay .Op Ar -S .Op Ar -v .Op Ar -h @@ -24,7 +24,7 @@ is not specified. .Pp .Nm supports both vi-like and emacs-like key bindings in the default -configuration. The default key bindings are listed below. +configuration. The default key bindings are listed below. .Pp .Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact .It Ic [Up], k, ^P @@ -43,6 +43,8 @@ .It Ic [Right], [Enter], l, ^M Open file or enter directory .It Ic [Left], [Backspace], h, ^H Back up one directory level +.It Ic [Insert] +Toggle navigate-as-you-type mode .It Ic ~ Change to the HOME directory .It Ic & @@ -61,8 +63,6 @@ .It Ic d Toggle detail view .It Ic D Toggle current file details screen -.It Ic f -Toggle navigate-as-you-type mode .It Ic m Show concise mediainfo .It Ic M @@ -104,10 +104,10 @@ .Pp .Fl d start in detail view mode .Pp -.Fl f +.Fl i start in navigate-as-you-type mode .Pp -.Fl p +.Fl "p custom_nlay" path to custom nlay .Pp .Fl S @@ -146,11 +146,11 @@ few easy steps. Please visit the project page (linked below) for the instructions. .Sh FILTERS Filters support regexes to display only the matched -entries in the current directory view. This effectively allows +entries in the current directory view. This effectively allows searching through the directory tree for a particular entry. Matching entries are shown instantly (search-as-you-type). .Pp -Filters do not stack on top of each other. They are applied anew +Filters do not stack on top of each other. They are applied anew every time. There are 4 ways to reset a filter: .Pp The \fIInsert\fR key, an empty filter expression, a search with no results or an diff --git a/nnn.c b/nnn.c index 1e2e8317fedbaa1da54fa94c1dec3cb11de5d5c2..bc2aee7facbf045d1c74185202336439a63c1a9c 100644 --- a/nnn.c +++ b/nnn.c @@ -1248,6 +1248,7 @@ Home, g, ^, ^A | Jump to first entry\n\ End, G, $, ^E | Jump to last entry\n\ Right, Enter, l, ^M | Open file or enter dir\n\ Left, Bksp, h, ^H | Go to parent dir\n\ + Insert | Toggle navigate-as-you-type mode\n\ ~ | Jump to HOME dir\n\ & | Jump to initial dir\n\ - | Jump to last visited dir\n\ @@ -1257,7 +1258,6 @@ . | Toggle hide .dot files\n\ c | Show change dir prompt\n\ d | Toggle detail view\n\ D | Toggle current file details screen\n\ - f | Toggle navigate-as-you-type mode\n\ m | Show concise mediainfo\n\ M | Show full mediainfo\n\ s | Toggle sort by file size\n\ @@ -2092,13 +2092,13 @@ static void usage(void) { - fprintf(stdout, "usage: nnn [-d] [-p custom_nlay] [-S] [-v] [-h] [PATH]\n\n\ + fprintf(stdout, "usage: nnn [-d] [-i] [-p custom_nlay] [-S] [-v] [-h] [PATH]\n\n\ The missing terminal file browser for X.\n\n\ positional arguments:\n\ PATH directory to open [default: current dir]\n\n\ optional arguments:\n\ -d start in detail view mode\n\ - -f start in navigate-as-you-type mode\n\ + -i start in navigate-as-you-type mode\n\ -p path to custom nlay\n\ -S start in disk usage analyzer mode\n\ -v show program version and exit\n\ @@ -2123,7 +2123,7 @@ fprintf(stderr, "stdin or stdout is not a tty\n"); exit(1); } - while ((opt = getopt(argc, argv, "dSfp:vh")) != -1) { + while ((opt = getopt(argc, argv, "dSip:vh")) != -1) { switch (opt) { case 'S': bsizeorder = 1; // fallthrough @@ -2132,7 +2132,7 @@ /* Open in detail mode, if set */ showdetail = 1; printptr = &printent_long; break; - case 'f': + case 'i': filtermode = 1; break; case 'p':