```
usage: nnn [-b key] [-C] [-e] [-i] [-l] [-n]
- [-p file] [-s] [-S] [-v] [-h] [PATH]
+ [-p file] [-s] [-S] [-v] [-w] [-h] [PATH]
The missing terminal file manager for X.
-s string filters [default: regex]
-S du mode
-v show version
+ -w wild mode
-h show help
```
-`>` indicates the currently selected entry in `nnn`.
-
#### Keyboard shortcuts
Press <kbd>?</kbd> in `nnn` to see the list anytime.
e Edit in EDITOR p Open in PAGER
ORDER TOGGLES
^J Disk usage S Apparent du
- t Time modified s Size
+ ^W Random s Size t Time modified
MISC
! ^] Spawn SHELL C Execute entry
R ^V Run/pick script L Lock terminal
export NNN_NO_AUTOSELECT=1
+The _wild mode_ program option can be handy for users who use this mode constantly. The entries are unsorted when the directory loads. Applying filters sort the entries (with directories on top). Directory color is disabled in this mode.
+
#### File indicators
The following indicators are used in the detail view:
uint dircolor : 1; /* Current status of dir color */
uint metaviewer : 1; /* Index of metadata viewer in utils[] */
uint ctxactive : 1; /* Context active or not */
- uint reserved : 8;
+ uint reserved : 7;
/* The following settings are global */
uint curctx : 2; /* Current context number */
uint picker : 1; /* Write selection to user-specified file */
uint runctx : 2; /* The context in which script is to be run */
uint restrict0b : 1; /* Restrict 0-byte file opening */
uint filter_re : 1; /* Use regex filters */
+ uint wild : 1; /* Do not sort entries on dir load */
} settings;
/* Contexts or workspaces */
/* GLOBALS */
/* Configuration, contexts */
-static settings cfg = {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
+static settings cfg = {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0};
static context g_ctx[CTX_MAX] __attribute__ ((aligned));
static struct entry *dents;
"ce Edit in EDITOR p Open in PAGER\n"
"1ORDER TOGGLES\n"
"b^J Disk usage S Apparent du\n"
- "ct Time modified s Size\n"
+ "b^W Random s Size t Time modified\n"
"1MISC\n"
"9! ^] Spawn SHELL C Execute entry\n"
"9R ^V Run/pick script L Lock terminal\n"
if (!ndents)
return;
- qsort(dents, ndents, sizeof(*dents), entrycmp);
+ if (!cfg.wild)
+ qsort(dents, ndents, sizeof(*dents), entrycmp);
#ifdef DBGMODE
clock_gettime(CLOCK_REALTIME, &ts2);
else
ncols -= 5;
- if (cfg.showcolor) {
+ if (!cfg.wild && cfg.showcolor) {
attron(COLOR_PAIR(cfg.curctx + 1) | A_BOLD);
cfg.dircolor = 1;
}
}
#endif
presel = filterentries(path);
+
/* Save current */
if (ndents)
copycurname();
case SEL_FSIZE: // fallthrough
case SEL_ASIZE: // fallthrough
case SEL_BSIZE: // fallthrough
- case SEL_MTIME:
+ case SEL_MTIME: // fallthrough
+ case SEL_WILD:
switch (sel) {
case SEL_MFLTR:
cfg.filtermode ^= 1;
cfg.apparentsz = 0;
cfg.blkorder = 0;
cfg.copymode = 0;
+ cfg.wild = 0;
break;
case SEL_ASIZE:
cfg.apparentsz ^= 1;
cfg.blkorder = 1;
BLK_SHIFT = 0;
} else
- cfg.blkorder = 0;
- break;
+ cfg.blkorder = 0; // fallthrough
case SEL_BSIZE:
if (sel == SEL_BSIZE) {
if (!cfg.apparentsz)
cfg.mtimeorder = 0;
cfg.sizeorder = 0;
cfg.copymode = 0;
+ cfg.wild = 0;
break;
- default: /* SEL_MTIME */
+ case SEL_MTIME:
cfg.mtimeorder ^= 1;
cfg.sizeorder = 0;
cfg.apparentsz = 0;
cfg.blkorder = 0;
cfg.copymode = 0;
+ cfg.wild = 0;
break;
+ default: /* SEL_WILD */
+ cfg.wild ^= 1;
+ cfg.mtimeorder = 0;
+ cfg.sizeorder = 0;
+ cfg.apparentsz = 0;
+ cfg.blkorder = 0;
+ cfg.copymode = 0;
+ setdirwatch();
+ goto nochange;
}
/* Save current */
{
fprintf(stdout,
"%s: nnn [-b key] [-C] [-e] [-i] [-l] [-n]\n"
- " [-p file] [-s] [-S] [-v] [-h] [PATH]\n\n"
+ " [-p file] [-s] [-S] [-v] [-w] [-h] [PATH]\n\n"
"The missing terminal file manager for X.\n\n"
"positional args:\n"
" PATH start dir [default: current dir]\n\n"
" -s string filters [default: regex]\n"
" -S du mode\n"
" -v show version\n"
+ " -w wild mode\n"
" -h show help\n\n"
"v%s\n%s\n", __func__, VERSION, GENERAL_INFO);
}
char *ipath = NULL;
int opt;
- while ((opt = getopt(argc, argv, "Slib:Cenp:svh")) != -1) {
+ while ((opt = getopt(argc, argv, "Slib:Cenp:svwh")) != -1) {
switch (opt) {
case 'S':
cfg.blkorder = 1;
case 'v':
fprintf(stdout, "%s\n", VERSION);
return 0;
+ case 'w':
+ cfg.wild = 1;
+ break;
case 'h':
usage();
return 0;