- By file name, modification/access time, size, extension
- Search
- Instant filtering with *search-as-you-type*
- - Regex (default) and substring match
+ - Regex and substring (default) matches
- Subtree search to open or edit files (using plugin)
- Mimes
- Open with desktop opener or specify a custom app
-e name load session by name
-E use EDITOR for undetached edits
-f run filter as cmd on prompt key
+ -g regex filters [default: string]
-H show hidden files
-i nav-as-you-type mode
-K detect key collision
-p file selection file [stdout if '-']
-r use advcpmv patched cp, mv
-R disable rollover at edges
- -s string filters [default: regex]
-S du mode
-t disable dir auto-select
-v show version
.Op Ar -e name
.Op Ar -E
.Op Ar -f
+.Op Ar -g
.Op Ar -H
.Op Ar -i
.Op Ar -K
.Op Ar -p file
.Op Ar -r
.Op Ar -R
-.Op Ar -s
.Op Ar -S
.Op Ar -v
.Op Ar -x
.Fl f
run filter as command when the prompt key is pressed
.Pp
+.Fl g
+ use regex filters instead of substring match
+.Pp
.Fl H
show hidden files
.Pp
.Fl R
disable rollover at edges
.Pp
-.Fl s
- use substring match for filters instead of regex
-.Pp
.Fl S
start in disk usage analyzer mode
.Pp
All the session files are located in the \fB${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions\fR directory by the session name.
"@" is the "last session" file.
.Sh FILTERS
-Filters support regexes (default) to instantly (search-as-you-type) list the matching
-entries in the current directory.
+Filters are substrings to find matching entries in the current directory instantly (search-as-you-type). There is a program option to use regex filters.
.Pp
-Common use cases:
+Common regex use cases:
.Pp
(1) To list all matches starting with the filter expression, start the expression
with a '^' (caret) symbol.
.br
(3) Use '.*' to match any character (\fIsort of\fR fuzzy search).
.Pp
-There is a program option to filter entries by substring match instead of regex.
-.Pp
There is a program option to execute the current filter as a command when the prompt key is pressed.
.Pp
In the \fInavigate-as-you-type\fR mode directories are opened in filter mode,
0, /* useeditor */
0, /* runplugin */
0, /* runctx */
- 1, /* filter_re */
+ 0, /* filter_re */
0, /* filtercmd */
0, /* trash */
1, /* mtime */
return strcasestr(fname, fltrexp->str) != NULL;
}
-static int (*filterfn)(const fltrexp_t *fltr, const char *fname) = &visible_re;
+static int (*filterfn)(const fltrexp_t *fltr, const char *fname) = &visible_str;
static int entrycmp(const void *va, const void *vb)
{
" -e name load session by name\n"
" -E use EDITOR for undetached edits\n"
" -f run filter as cmd on prompt key\n"
+ " -g regex filters [default: string]\n"
" -H show hidden files\n"
" -i nav-as-you-type mode\n"
" -K detect key collision\n"
" -p file selection file [stdout if '-']\n"
" -r use advcpmv patched cp, mv\n"
" -R disable rollover at edges\n"
- " -s string filters [default: regex]\n"
" -S du mode\n"
" -t disable dir auto-select\n"
" -v show version\n"
bool progress = FALSE;
#endif
- while ((opt = getopt(argc, argv, "HSKiab:cde:Efnop:rRstvxh")) != -1) {
+ while ((opt = getopt(argc, argv, "HSKiab:cde:Efgnop:rRtvxh")) != -1) {
switch (opt) {
case 'S':
cfg.blkorder = 1;
case 'f':
cfg.filtercmd = 1;
break;
+ case 'g':
+ cfg.filter_re = 1;
+ filterfn = &visible_re;
+ break;
case 'H':
cfg.showhidden = 1;
break;
case 'R':
cfg.rollover = 0;
break;
- case 's':
- cfg.filter_re = 0;
- filterfn = &visible_str;
- break;
case 't':
cfg.autoselect = 0;
break;