mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Change nav-as-you-type to type-to-nav
This commit is contained in:
parent
806b91b60d
commit
f54d51c863
10
README.md
10
README.md
|
@ -12,7 +12,7 @@
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center"><a href="https://www.youtube.com/watch?v=U2n5aGqou9E"><img src="https://i.imgur.com/MPWpmos.png" /></a></p>
|
<p align="center"><a href="https://www.youtube.com/watch?v=U2n5aGqou9E"><img src="https://i.imgur.com/MPWpmos.png" /></a></p>
|
||||||
<p align="center"><i>navigate-as-you-type & du (click to see demo video)</i></p>
|
<p align="center"><i>type-to-nav & du (click to see demo video)</i></p>
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
|
@ -25,10 +25,10 @@ It runs smoothly on the Pi, [Termux](https://www.youtube.com/watch?v=AbaauM7gUJw
|
||||||
## Black magic! :dark_sunglasses:
|
## Black magic! :dark_sunglasses:
|
||||||
|
|
||||||
1. Load, sort, filter thousands of files instantly
|
1. Load, sort, filter thousands of files instantly
|
||||||
2. Turbo navigate with automatic dir selection
|
2. Type to navigate with automatic dir selection
|
||||||
3. Select files from anywhere (not just a single dir)
|
3. Select files from anywhere (not just a single dir)
|
||||||
4. Edit and preview markdown, man page, html
|
4. Edit and preview markdown, man page, html
|
||||||
5. Open a file and auto-proceed to the next
|
5. Open a file and auto-advance to the next
|
||||||
6. Export (filtered) list of visible files
|
6. Export (filtered) list of visible files
|
||||||
7. Find files by mime-type and list in `nnn`
|
7. Find files by mime-type and list in `nnn`
|
||||||
8. Unlimited bookmarks, plugins, commands with custom hotkeys
|
8. Unlimited bookmarks, plugins, commands with custom hotkeys
|
||||||
|
@ -79,13 +79,13 @@ Once installed (instructions below), _**read the fine [manual](https://github.co
|
||||||
- Disk usage analyzer (block/apparent)
|
- Disk usage analyzer (block/apparent)
|
||||||
- File picker, (neo)vim plugin
|
- File picker, (neo)vim plugin
|
||||||
- Navigation
|
- Navigation
|
||||||
- *Navigate-as-you-type* with dir auto-select
|
- *Type-to-nav* mode with dir auto-select
|
||||||
- Contexts (_aka_ tabs/workspaces) with custom colors
|
- Contexts (_aka_ tabs/workspaces) with custom colors
|
||||||
- Sessions, bookmarks with hotkeys; pin and visit a dir
|
- Sessions, bookmarks with hotkeys; pin and visit a dir
|
||||||
- Remote mounts (needs sshfs, rclone)
|
- Remote mounts (needs sshfs, rclone)
|
||||||
- Familiar shortcuts (arrows, <kbd>~</kbd>, <kbd>-</kbd>, <kbd>@</kbd>), quick reference
|
- Familiar shortcuts (arrows, <kbd>~</kbd>, <kbd>-</kbd>, <kbd>@</kbd>), quick reference
|
||||||
- CD on quit (*easy* shell integration)
|
- CD on quit (*easy* shell integration)
|
||||||
- Auto-proceed on opening files
|
- Auto-advance on opening files
|
||||||
- Search
|
- Search
|
||||||
- Instant filtering with *search-as-you-type*
|
- Instant filtering with *search-as-you-type*
|
||||||
- Regex (POSIX/PCRE) and string (default) filters
|
- Regex (POSIX/PCRE) and string (default) filters
|
||||||
|
|
|
@ -22,7 +22,7 @@ complete -c nnn -s F -d 'show fortune'
|
||||||
complete -c nnn -s g -d 'regex filters'
|
complete -c nnn -s g -d 'regex filters'
|
||||||
complete -c nnn -s H -d 'show hidden files'
|
complete -c nnn -s H -d 'show hidden files'
|
||||||
complete -c nnn -s K -d 'detect key collision'
|
complete -c nnn -s K -d 'detect key collision'
|
||||||
complete -c nnn -s n -d 'start in navigate-as-you-type mode'
|
complete -c nnn -s n -d 'start in type-to-nav mode'
|
||||||
complete -c nnn -s o -d 'open files only on Enter'
|
complete -c nnn -s o -d 'open files only on Enter'
|
||||||
complete -c nnn -s p -r -d 'copy selection to file' -a '-\tstdout'
|
complete -c nnn -s p -r -d 'copy selection to file' -a '-\tstdout'
|
||||||
complete -c nnn -s Q -d 'disable quit confirmation'
|
complete -c nnn -s Q -d 'disable quit confirmation'
|
||||||
|
|
|
@ -20,7 +20,7 @@ args=(
|
||||||
'(-g)-g[regex filters]'
|
'(-g)-g[regex filters]'
|
||||||
'(-H)-H[show hidden files]'
|
'(-H)-H[show hidden files]'
|
||||||
'(-K)-K[detect key collision]'
|
'(-K)-K[detect key collision]'
|
||||||
'(-n)-n[start in navigate-as-you-type mode]'
|
'(-n)-n[start in type-to-nav mode]'
|
||||||
'(-o)-o[open files only on Enter]'
|
'(-o)-o[open files only on Enter]'
|
||||||
'(-p)-p[copy selection to file]:file name'
|
'(-p)-p[copy selection to file]:file name'
|
||||||
'(-Q)-Q[disable quit confirmation]'
|
'(-Q)-Q[disable quit confirmation]'
|
||||||
|
|
12
nnn.1
12
nnn.1
|
@ -34,7 +34,7 @@
|
||||||
.Nm
|
.Nm
|
||||||
(Nnn's Not Noice) is a performance-optimized, feature-packed fork of
|
(Nnn's Not Noice) is a performance-optimized, feature-packed fork of
|
||||||
noice (http://git.2f30.org/noice/) with seamless desktop
|
noice (http://git.2f30.org/noice/) with seamless desktop
|
||||||
integration, simplified navigation, \fInavigate-as-you-type\fR mode with
|
integration, simplified navigation, \fItype-to-nav\fR mode with
|
||||||
auto select, disk usage analyzer mode, bookmarks, contexts, application
|
auto select, disk usage analyzer mode, bookmarks, contexts, application
|
||||||
launcher, familiar navigation shortcuts, subshell spawning and much
|
launcher, familiar navigation shortcuts, subshell spawning and much
|
||||||
more.It remains a simple and efficient file manager that stays out of your way.
|
more.It remains a simple and efficient file manager that stays out of your way.
|
||||||
|
@ -54,7 +54,7 @@ to see the list of keybinds.
|
||||||
supports the following options:
|
supports the following options:
|
||||||
.Pp
|
.Pp
|
||||||
.Fl A
|
.Fl A
|
||||||
disable directory auto-select in navigate-as-you-type mode
|
disable directory auto-select in type-to-nav mode
|
||||||
.Pp
|
.Pp
|
||||||
.Fl "b key"
|
.Fl "b key"
|
||||||
specify bookmark key to open
|
specify bookmark key to open
|
||||||
|
@ -87,7 +87,7 @@ supports the following options:
|
||||||
test for keybind collision
|
test for keybind collision
|
||||||
.Pp
|
.Pp
|
||||||
.Fl n
|
.Fl n
|
||||||
start in navigate-as-you-type mode
|
start in type-to-nav mode
|
||||||
.Pp
|
.Pp
|
||||||
.Fl o
|
.Fl o
|
||||||
open files only on Enter key
|
open files only on Enter key
|
||||||
|
@ -197,13 +197,13 @@ Special keys at \fBempty filter prompt\fR:
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
Additional special keys at \fBempty filter prompt\fR
|
Additional special keys at \fBempty filter prompt\fR
|
||||||
in \fBnav-as-you-type\fR mode:
|
in \fBtype-to-nav\fR mode:
|
||||||
.Bd -literal
|
.Bd -literal
|
||||||
------ + ------------------------
|
------ + ------------------------
|
||||||
Key | Function
|
Key | Function
|
||||||
------ + ------------------------
|
------ + ------------------------
|
||||||
' | Go to first non-dir file
|
' | Go to first non-dir file
|
||||||
+ | Toggle proceed on open
|
+ | Toggle auto-advance
|
||||||
, | Pin CWD
|
, | Pin CWD
|
||||||
- | Go to last visited dir
|
- | Go to last visited dir
|
||||||
. | Show hidden files
|
. | Show hidden files
|
||||||
|
@ -228,7 +228,7 @@ Common regex use cases:
|
||||||
.br
|
.br
|
||||||
(4) Exclude filenames having 'nnn' (compiled with PCRE lib): '^(?!nnn)'
|
(4) Exclude filenames having 'nnn' (compiled with PCRE lib): '^(?!nnn)'
|
||||||
.Pp
|
.Pp
|
||||||
In the \fInavigate-as-you-type\fR mode directories are opened in filter
|
In the \fItype-to-nav\fR mode directories are opened in filter
|
||||||
mode, allowing continuous navigation.
|
mode, allowing continuous navigation.
|
||||||
.br
|
.br
|
||||||
When there's a unique match and it's a directory,
|
When there's a unique match and it's a directory,
|
||||||
|
|
18
src/nnn.c
18
src/nnn.c
|
@ -262,7 +262,7 @@ typedef struct {
|
||||||
uint picker : 1; /* Write selection to user-specified file */
|
uint picker : 1; /* Write selection to user-specified file */
|
||||||
uint pickraw : 1; /* Write selection to sdtout before exit */
|
uint pickraw : 1; /* Write selection to sdtout before exit */
|
||||||
uint nonavopen : 1; /* Open file on right arrow or `l` */
|
uint nonavopen : 1; /* Open file on right arrow or `l` */
|
||||||
uint autoselect : 1; /* Auto-select dir in nav-as-you-type mode */
|
uint autoselect : 1; /* Auto-select dir in type-to-nav mode */
|
||||||
uint metaviewer : 1; /* Index of metadata viewer in utils[] */
|
uint metaviewer : 1; /* Index of metadata viewer in utils[] */
|
||||||
uint useeditor : 1; /* Use VISUAL to open text files */
|
uint useeditor : 1; /* Use VISUAL to open text files */
|
||||||
uint runplugin : 1; /* Choose plugin mode */
|
uint runplugin : 1; /* Choose plugin mode */
|
||||||
|
@ -2562,7 +2562,7 @@ static int filterentries(char *path, char *lastname)
|
||||||
if (cfg.filtermode) {
|
if (cfg.filtermode) {
|
||||||
switch (*ch) {
|
switch (*ch) {
|
||||||
case '\'': // fallthrough /* Go to first non-dir file */
|
case '\'': // fallthrough /* Go to first non-dir file */
|
||||||
case '+': // fallthrough /* Toggle proceed on open */
|
case '+': // fallthrough /* Toggle auto-advance */
|
||||||
case ',': // fallthrough /* Pin CWD */
|
case ',': // fallthrough /* Pin CWD */
|
||||||
case '-': // fallthrough /* Visit last visited dir */
|
case '-': // fallthrough /* Visit last visited dir */
|
||||||
case '.': // fallthrough /* Show hidden files */
|
case '.': // fallthrough /* Show hidden files */
|
||||||
|
@ -3712,7 +3712,7 @@ static char *visit_parent(char *path, char *newpath, int *presel)
|
||||||
|
|
||||||
/* There is no going back */
|
/* There is no going back */
|
||||||
if (istopdir(path)) {
|
if (istopdir(path)) {
|
||||||
/* Continue in navigate-as-you-type mode, if enabled */
|
/* Continue in type-to-nav mode, if enabled */
|
||||||
if (cfg.filtermode && presel)
|
if (cfg.filtermode && presel)
|
||||||
*presel = FILTER;
|
*presel = FILTER;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -4085,14 +4085,14 @@ static void show_help(const char *path)
|
||||||
"9G ^E End%-21c0 Lock terminal\n"
|
"9G ^E End%-21c0 Lock terminal\n"
|
||||||
"9b ^/ Bookmark key%-12c, Pin CWD\n"
|
"9b ^/ Bookmark key%-12c, Pin CWD\n"
|
||||||
"a1-4 Context 1-4%-7c(Sh)Tab Cycle context\n"
|
"a1-4 Context 1-4%-7c(Sh)Tab Cycle context\n"
|
||||||
"c/ Filter%-17c^N Nav-as-you-type toggle\n"
|
"c/ Filter%-17c^N Toggle type-to-nav\n"
|
||||||
"aEsc Exit prompt%-12c^L Redraw/clear prompt\n"
|
"aEsc Exit prompt%-12c^L Redraw/clear prompt\n"
|
||||||
"c? Help, conf%-14c+ Toggle proceed on open\n"
|
"c? Help, conf%-14c+ Toggle auto-advance\n"
|
||||||
"cq Quit context%-11c^G QuitCD\n"
|
"cq Quit context%-11c^G QuitCD\n"
|
||||||
"b^Q Quit%-20cQ Quit with err\n"
|
"b^Q Quit%-20cQ Quit with err\n"
|
||||||
"1FILES\n"
|
"1FILES\n"
|
||||||
"9o ^O Open with...%-12cn Create new/link\n"
|
"9o ^O Open with...%-12cn Create new/link\n"
|
||||||
"9f ^F File details%-12cd Detail view toggle\n"
|
"9f ^F File details%-12cd Detail mode toggle\n"
|
||||||
"b^R Rename/dup%-14cr Batch rename\n"
|
"b^R Rename/dup%-14cr Batch rename\n"
|
||||||
"cz Archive%-17ce Edit in EDITOR\n"
|
"cz Archive%-17ce Edit in EDITOR\n"
|
||||||
"5Space ^J (Un)select%-11cm ^K Mark range/clear\n"
|
"5Space ^J (Un)select%-11cm ^K Mark range/clear\n"
|
||||||
|
@ -5718,7 +5718,7 @@ nochange:
|
||||||
|
|
||||||
/* In case of successful operation, reload contents */
|
/* In case of successful operation, reload contents */
|
||||||
|
|
||||||
/* Continue in navigate-as-you-type mode, if enabled */
|
/* Continue in type-to-nav mode, if enabled */
|
||||||
if ((cfg.filtermode || filterset()) && !refresh)
|
if ((cfg.filtermode || filterset()) && !refresh)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -6202,7 +6202,7 @@ nochange:
|
||||||
r = FALSE;
|
r = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Continue in navigate-as-you-type mode, if enabled */
|
/* Continue in type-to-nav mode, if enabled */
|
||||||
if (cfg.filtermode)
|
if (cfg.filtermode)
|
||||||
presel = FILTER;
|
presel = FILTER;
|
||||||
|
|
||||||
|
@ -6567,7 +6567,7 @@ static void usage(void)
|
||||||
" -g regex filters [default: string]\n"
|
" -g regex filters [default: string]\n"
|
||||||
" -H show hidden files\n"
|
" -H show hidden files\n"
|
||||||
" -K detect key collision\n"
|
" -K detect key collision\n"
|
||||||
" -n nav-as-you-type mode\n"
|
" -n type-to-nav mode\n"
|
||||||
" -o open files only on Enter\n"
|
" -o open files only on Enter\n"
|
||||||
" -p file selection file [stdout if '-']\n"
|
" -p file selection file [stdout if '-']\n"
|
||||||
" -Q no quit confirmation\n"
|
" -Q no quit confirmation\n"
|
||||||
|
|
Loading…
Reference in a new issue