mirror of
https://github.com/jarun/nnn.git
synced 2024-11-17 08:32:36 +00:00
Enable automatic dir entry on unique filer match
This commit is contained in:
parent
56f96c3d0a
commit
581e629c20
|
@ -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`)
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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]'
|
||||
|
|
37
nnn.1
37
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!
|
||||
|
|
Loading…
Reference in a new issue