]> Sergey Matveev's repositories - nnn.git/commitdiff
Enable automatic dir entry on unique filer match
authorArun Prakash Jana <engineerarun@gmail.com>
Tue, 14 Jun 2022 08:19:41 +0000 (13:49 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Tue, 14 Jun 2022 08:19:41 +0000 (13:49 +0530)
README.md
misc/auto-completion/fish/nnn.fish
misc/auto-completion/zsh/_nnn
nnn.1
src/nnn.c

index fd24bc5f8b03f30001e048920357a2ce36aa4234..412c26b73ad68a32dcac7b05821141b41290028a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -58,7 +58,8 @@ Runs on the Pi, [Termux](https://www.youtube.com/embed/AbaauM7gUJw) (Android), L
   - Disk usage analyzer (block/apparent)
   - File picker, (neo)vim plugin
 - Navigation
-  - *Type-to-nav* mode with automatic matching dir entry
+  - Filter with automatic dir entry on unique match
+  - *Type-to-nav* (turbo navigation/always filter) mode
   - Contexts (_aka_ tabs/workspaces) with custom colors
   - Sessions, bookmarks, mark and visit a dir
   - Remote mounts (needs `sshfs`, `rclone`)
index 968759fdec46551a56f5687dae3565171335398d..05f92ae2e889b53449f70219186472aac97c0362 100644 (file)
@@ -12,7 +12,7 @@ else
 end
 
 complete -c nnn -s a    -d 'auto-create NNN_FIFO'
-complete -c nnn -s A    -d 'disable dir auto-select'
+complete -c nnn -s A    -d 'disable dir auto-enter'
 complete -c nnn -s b -r -d 'bookmark key to open' -x -a '(echo $NNN_BMS | awk -F: -v RS=\; \'{print $1"\t"$2}\')'
 complete -c nnn -s c    -d 'cli-only opener'
 complete -c nnn -s C    -d 'color by context'
index c2dfb31e76659a1a87dbe6b307320c725fa40cf5..8de4bdfe7e230f96e7ec3ff7a2f621f6648ef941 100644 (file)
@@ -10,7 +10,7 @@ setopt localoptions noshwordsplit noksharrays
 local -a args
 args=(
     '(-a)-a[auto-create NNN_FIFO]'
-    '(-A)-A[disable dir auto-select]'
+    '(-A)-A[disable dir auto-enter]'
     '(-b)-b[bookmark key to open]:key char'
     '(-c)-c[cli-only opener]'
     '(-C)-C[color by context]'
diff --git a/nnn.1 b/nnn.1
index ed1d7eb820da53530f6affce22b7e22a7568c735..6e7915bfa35936bd32a3190dd5d3e2d4ed8e4e1a 100644 (file)
--- a/nnn.1
+++ b/nnn.1
@@ -201,6 +201,10 @@ Filters are strings (or regex patterns) to find matching entries in the current
 directory instantly (\fIsearch-as-you-type\fR). Matches are case-insensitive by
 default. The last filter in each context is persisted at runtime or in saved
 sessions.
+.br
+When there's a unique match and it's a directory,
+.Nm
+auto enters the directory. Use the relevant program option to disable this.
 .Pp
 Special keys at filter prompt:
 .Bd -literal
@@ -228,6 +232,20 @@ Special keys at \fBempty filter prompt\fR:
 ------ + ---------------------------------------
 .Ed
 .Pp
+Common regex use cases:
+.Pp
+(1) To list all matches starting with the filter expression,
+    start the expression with a '^' (caret) symbol.
+.br
+(2) Type '\\.mkv' to list all MKV files.
+.br
+(3) Use '.*' to match any character (\fIsort of\fR fuzzy search).
+.br
+(4) Exclude filenames having 'nnn' (compiled with PCRE lib): '^(?!nnn)'
+.Pp
+In the \fBtype-to-nav\fR mode directories are opened in filter
+mode, allowing continuous navigation.
+.Pp
 Additional special keys at \fBempty filter prompt\fR
 in \fBtype-to-nav\fR mode:
 .Bd -literal
@@ -248,25 +266,6 @@ in \fBtype-to-nav\fR mode:
    ~   | Go HOME
 ------ + ------------------------
 .Ed
-.Pp
-Common regex use cases:
-.Pp
-(1) To list all matches starting with the filter expression,
-    start the expression with a '^' (caret) symbol.
-.br
-(2) Type '\\.mkv' to list all MKV files.
-.br
-(3) Use '.*' to match any character (\fIsort of\fR fuzzy search).
-.br
-(4) Exclude filenames having 'nnn' (compiled with PCRE lib): '^(?!nnn)'
-.Pp
-In the \fItype-to-nav\fR mode directories are opened in filter
-mode, allowing continuous navigation.
-.br
-When there's a unique match and it's a directory,
-.Nm
-auto enters it in this mode. Use the relevant program option to disable this
-behaviour.
 .Sh SELECTION
 .Nm
 allows file selection across directories and contexts!
index ed673b0623b90ae2b28d0356cd8207e47061bddd..6dfcb7774d320399e03223c832806eede80e906f 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -8163,7 +8163,7 @@ static void usage(void)
 #ifndef NOFIFO
                " -a      auto NNN_FIFO\n"
 #endif
-               " -A      no dir auto-enter in type-to-nav\n"
+               " -A      disable dir auto-enter\n"
                " -b key  open bookmark key (trumps -s/S)\n"
                " -c      cli-only NNN_OPENER (trumps -e)\n"
                " -C      8-color scheme\n"