```
usage: nnn [-b key] [-C] [-e] [-i] [-l] [-n]
- [-p file] [-S] [-v] [-h] [PATH]
+ [-p file] [-s] [-S] [-v] [-h] [PATH]
The missing terminal file manager for X.
-l light mode
-n use version compare to sort
-p file selection file (stdout if '-')
+ -s string filters [default: regex]
-S disk usage mode
-v show version
-h show help
- type `\.mkv` to list all MKV files
- use `.*` to match any character (_sort of_ fuzzy search)
-To filter entries by substring match:
-
- export NNN_PLAIN_FILTER=1
+There is a program opton to filter entries by substring match.
If `nnn` is invoked as root or the environment variable `NNN_SHOW_HIDDEN` is set the default filter will also match hidden files.
| `NNN_NO_AUTOSELECT=1` | do not auto-select matching dir in _nav-as-you-type` mode |
| `NNN_RESTRICT_NAV_OPEN=1` | open files on <kbd> ↵</kbd>, not <kbd>→</kbd> or <kbd>l</kbd> |
| `NNN_RESTRICT_0B=1` | do not open 0-byte files |
-| `NNN_PLAIN_FILTER=1` | use substring match in filer mode [default: regex] |
#### Help
.Op Ar -e
.Op Ar -i
.Op Ar -l
+.Op Ar -n
.Op Ar -p file
+.Op Ar -s
.Op Ar -S
.Op Ar -v
.Op Ar -h
.Fl "p file"
copy (or \fIpick\fR) selection to file, or stdout if file='-'
.Pp
+.Fl s
+ use substring match for filters instead of regex
+.Pp
.Fl S
start in disk usage analyzer mode
.Pp
.br
(3) Use '.*' to match any character (\fIsort of\fR fuzzy search).
.Pp
-To filter entries by substring match export the environment variable \fBNNN_PLAIN_FILTER\fR.
+There is a program option to filter entries by substring match.
.Pp
If
.Nm
.Bd -literal
export NNN_RESTRICT_0B=1
.Ed
-.Pp
-\fBNNN_PLAIN_FILTER:\fR use substring match in filter mode.
-.Bd -literal
- export NNN_PLAIN_FILTER=1
-.Ed
.Sh KNOWN ISSUES
If you are using urxvt you might have to set backspace key to DEC.
.Sh AUTHORS
complete -c nnn -s l -d 'start in light mode (fewer details)'
complete -c nnn -s n -d 'use version compare to sort files'
complete -c nnn -s p -r -d 'copy selection to file'
+complete -c nnn -s s -d 'use substring match for filters'
complete -c nnn -s S -d 'start in disk usage analyzer mode'
complete -c nnn -s v -d 'show program version and exit'
'(-l)-l[start in light mode (fewer details)]'
'(-n)-n[use version compare to sort files]'
'(-p)-p[copy selection to file]:file name'
+ '(-s)-s[use substring match for filters]'
'(-S)-S[start in disk usage analyzer mode]'
'(-v)-v[show program version and exit]'
'*:filename:_files'
{
fprintf(stdout,
"usage: nnn [-b key] [-C] [-e] [-i] [-l] [-n]\n"
- " [-p file] [-S] [-v] [-h] [PATH]\n\n"
+ " [-p file] [-s] [-S] [-v] [-h] [PATH]\n\n"
"The missing terminal file manager for X.\n\n"
"positional args:\n"
" PATH start dir [default: current dir]\n\n"
" -l light mode\n"
" -n use version compare to sort\n"
" -p file selection file (stdout if '-')\n"
+ " -s string filters [default: regex]\n"
" -S disk usage mode\n"
" -v show version\n"
" -h show help\n\n"
char *ipath = NULL;
int opt;
- while ((opt = getopt(argc, argv, "Slib:Cenp:vh")) != -1) {
+ while ((opt = getopt(argc, argv, "Slib:Cenp:svh")) != -1) {
switch (opt) {
case 'S':
cfg.blkorder = 1;
}
}
break;
+ case 's':
+ cfg.filter_re = 0;
+ filterfn = &visible_str;
+ break;
case 'v':
fprintf(stdout, "%s\n", VERSION);
return 0;
if (getenv(env_cfg[NNN_RESTRICT_0B]))
cfg.restrict0b = 1;
- /* Use string-comparison in filter mode */
- if (getenv(env_cfg[NNN_PLAIN_FILTER])) {
- cfg.filter_re = 0;
- filterfn = &visible_str;
- }
-
/* Ignore certain signals */
signal(SIGINT, SIG_IGN);
signal(SIGQUIT, SIG_IGN);