mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Remove wild load option
This commit is contained in:
parent
8d16d6ac5f
commit
f4f1acf856
11
README.md
11
README.md
|
@ -70,7 +70,7 @@ Visit the **[Wiki](https://github.com/jarun/nnn/wiki)** for how tos, use cases,
|
||||||
- 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, *wild load*
|
- *Navigate-as-you-type* with dir auto-select
|
||||||
- 4 contexts (_aka_ tabs/workspaces)
|
- 4 contexts (_aka_ tabs/workspaces)
|
||||||
- Bookmarks; pin and visit a directory
|
- Bookmarks; pin and visit a directory
|
||||||
- Familiar, easy shortcuts (arrows, <kbd>~</kbd>, <kbd>-</kbd>, <kbd>@</kbd>)
|
- Familiar, easy shortcuts (arrows, <kbd>~</kbd>, <kbd>-</kbd>, <kbd>@</kbd>)
|
||||||
|
@ -209,7 +209,7 @@ Option completion scripts for Bash, Fish and Zsh can be found in respective subd
|
||||||
|
|
||||||
```
|
```
|
||||||
usage: nnn [-b key] [-d] [-e] [-H] [-i] [-n] [-o]
|
usage: nnn [-b key] [-d] [-e] [-H] [-i] [-n] [-o]
|
||||||
[-p file] [-s] [-S] [-t] [-v] [-w] [-h] [PATH]
|
[-p file] [-s] [-S] [-t] [-v] [-h] [PATH]
|
||||||
|
|
||||||
The missing terminal file manager for X.
|
The missing terminal file manager for X.
|
||||||
|
|
||||||
|
@ -229,7 +229,6 @@ optional args:
|
||||||
-S du mode
|
-S du mode
|
||||||
-t disable dir auto-select
|
-t disable dir auto-select
|
||||||
-v show version
|
-v show version
|
||||||
-w wild load
|
|
||||||
-h show help
|
-h show help
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -262,8 +261,8 @@ Press <kbd>?</kbd> in `nnn` to see the list anytime.
|
||||||
^F Extract archive F List archive
|
^F Extract archive F List archive
|
||||||
e Edit in EDITOR p Open in PAGER
|
e Edit in EDITOR p Open in PAGER
|
||||||
ORDER TOGGLES
|
ORDER TOGGLES
|
||||||
^J du E Extn S Apparent du
|
^J du S Apparent du
|
||||||
^W Random s Size t Time modified
|
s Size E Extn t Time modified
|
||||||
MISC
|
MISC
|
||||||
! ^] Shell L Lock C Execute entry
|
! ^] Shell L Lock C Execute entry
|
||||||
R ^V Pick plugin xK Run plugin key K
|
R ^V Pick plugin xK Run plugin key K
|
||||||
|
@ -374,8 +373,6 @@ When there's a unique match and it's a directory, `nnn` auto selects the directo
|
||||||
|
|
||||||
This mode takes navigation to the next level when short, unique keypress sequences are possible. For example, to reach `nnn` development directory (located at `~/GitHub/nnn`) from my `$HOME` (which is the default directory the terminal starts in), I use the sequence <kbd>g</kbd><kbd>n</kbd>.
|
This mode takes navigation to the next level when short, unique keypress sequences are possible. For example, to reach `nnn` development directory (located at `~/GitHub/nnn`) from my `$HOME` (which is the default directory the terminal starts in), I use the sequence <kbd>g</kbd><kbd>n</kbd>.
|
||||||
|
|
||||||
The **_wild load_** option can be extremely handy for users who use this mode constantly. The entries are unsorted when the directory loads. Applying filters sorts the entries (with directories on top). Directory color is disabled in this mode.
|
|
||||||
|
|
||||||
#### File indicators
|
#### File indicators
|
||||||
|
|
||||||
The following indicators are used in the detail view:
|
The following indicators are used in the detail view:
|
||||||
|
|
|
@ -23,7 +23,6 @@ _nnn () {
|
||||||
-S
|
-S
|
||||||
-t
|
-t
|
||||||
-v
|
-v
|
||||||
-w
|
|
||||||
-h
|
-h
|
||||||
)
|
)
|
||||||
if [[ $prev == -b ]]; then
|
if [[ $prev == -b ]]; then
|
||||||
|
|
|
@ -17,5 +17,4 @@ 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 S -d 'start in disk usage analyzer mode'
|
||||||
complete -c nnn -s t -d 'disable dir auto-select'
|
complete -c nnn -s t -d 'disable dir auto-select'
|
||||||
complete -c nnn -s v -d 'show program version and exit'
|
complete -c nnn -s v -d 'show program version and exit'
|
||||||
complete -c nnn -s w -d 'wild load'
|
|
||||||
complete -c nnn -s h -d 'show program help'
|
complete -c nnn -s h -d 'show program help'
|
||||||
|
|
|
@ -21,7 +21,6 @@ args=(
|
||||||
'(-S)-S[start in disk usage analyzer mode]'
|
'(-S)-S[start in disk usage analyzer mode]'
|
||||||
'(-t)-t[disable dir auto-select]'
|
'(-t)-t[disable dir auto-select]'
|
||||||
'(-v)-v[show program version and exit]'
|
'(-v)-v[show program version and exit]'
|
||||||
'(-w)-w[wild load]'
|
|
||||||
'(-h)-h[show program help]'
|
'(-h)-h[show program help]'
|
||||||
'*:filename:_files'
|
'*:filename:_files'
|
||||||
)
|
)
|
||||||
|
|
6
nnn.1
6
nnn.1
|
@ -16,7 +16,6 @@
|
||||||
.Op Ar -s
|
.Op Ar -s
|
||||||
.Op Ar -S
|
.Op Ar -S
|
||||||
.Op Ar -v
|
.Op Ar -v
|
||||||
.Op Ar -w
|
|
||||||
.Op Ar -h
|
.Op Ar -h
|
||||||
.Op Ar PATH
|
.Op Ar PATH
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
|
@ -73,9 +72,6 @@ supports the following options:
|
||||||
.Fl v
|
.Fl v
|
||||||
show version and exit
|
show version and exit
|
||||||
.Pp
|
.Pp
|
||||||
.Fl w
|
|
||||||
wild load - entries unsorted on directory load
|
|
||||||
.Pp
|
|
||||||
.Fl h
|
.Fl h
|
||||||
show program help and exit
|
show program help and exit
|
||||||
.Sh CONFIGURATION
|
.Sh CONFIGURATION
|
||||||
|
@ -124,8 +120,6 @@ In the \fInavigate-as-you-type\fR mode directories are opened in filter mode,
|
||||||
allowing continuous navigation. Works best with the \fBarrow keys\fR.
|
allowing continuous navigation. Works best with the \fBarrow keys\fR.
|
||||||
.br
|
.br
|
||||||
When there's a unique match and it's a directory, `nnn` auto selects the directory and enters it in this mode.
|
When there's a unique match and it's a directory, `nnn` auto selects the directory and enters it in this mode.
|
||||||
.br
|
|
||||||
The \fIwild load\fR option can be extremely handy for users who use the \fInavigate-as-you-type\fR mode constantly. The entries are unsorted when the directory loads. Applying filters sorts the entries (with directories on top). Directory color is disabled in this mode.
|
|
||||||
.Sh SELECTION
|
.Sh SELECTION
|
||||||
Use \fI^K\fR to select the file under the cursor.
|
Use \fI^K\fR to select the file under the cursor.
|
||||||
.Pp
|
.Pp
|
||||||
|
|
38
src/nnn.c
38
src/nnn.c
|
@ -215,7 +215,7 @@ typedef struct {
|
||||||
uint copymode : 1; /* Set when copying files */
|
uint copymode : 1; /* Set when copying files */
|
||||||
uint showdetail : 1; /* Clear to show fewer file info */
|
uint showdetail : 1; /* Clear to show fewer file info */
|
||||||
uint ctxactive : 1; /* Context active or not */
|
uint ctxactive : 1; /* Context active or not */
|
||||||
uint reserved : 7;
|
uint reserved : 8;
|
||||||
/* The following settings are global */
|
/* The following settings are global */
|
||||||
uint curctx : 2; /* Current context number */
|
uint curctx : 2; /* Current context number */
|
||||||
uint dircolor : 1; /* Current status of dir color */
|
uint dircolor : 1; /* Current status of dir color */
|
||||||
|
@ -228,7 +228,6 @@ typedef struct {
|
||||||
uint runplugin : 1; /* Choose plugin mode */
|
uint runplugin : 1; /* Choose plugin mode */
|
||||||
uint runctx : 2; /* The context in which plugin is to be run */
|
uint runctx : 2; /* The context in which plugin is to be run */
|
||||||
uint filter_re : 1; /* Use regex filters */
|
uint filter_re : 1; /* Use regex filters */
|
||||||
uint wild : 1; /* Do not sort entries on dir load */
|
|
||||||
uint trash : 1; /* Move removed files to trash */
|
uint trash : 1; /* Move removed files to trash */
|
||||||
} settings;
|
} settings;
|
||||||
|
|
||||||
|
@ -268,7 +267,6 @@ static settings cfg = {
|
||||||
0, /* runplugin */
|
0, /* runplugin */
|
||||||
0, /* runctx */
|
0, /* runctx */
|
||||||
1, /* filter_re */
|
1, /* filter_re */
|
||||||
0, /* wild */
|
|
||||||
0, /* trash */
|
0, /* trash */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2843,8 +2841,8 @@ static bool show_help(const char *path)
|
||||||
"b^F Extract archive F List archive\n"
|
"b^F Extract archive F List archive\n"
|
||||||
"ce Edit in EDITOR p Open in PAGER\n"
|
"ce Edit in EDITOR p Open in PAGER\n"
|
||||||
"1ORDER TOGGLES\n"
|
"1ORDER TOGGLES\n"
|
||||||
"b^J du E Extn S Apparent du\n"
|
"b^J du S Apparent du\n"
|
||||||
"b^W Random s Size t Time modified\n"
|
"cs Size E Extn t Time modified\n"
|
||||||
"1MISC\n"
|
"1MISC\n"
|
||||||
"9! ^] Shell L Lock C Execute entry\n"
|
"9! ^] Shell L Lock C Execute entry\n"
|
||||||
"9R ^V Pick plugin xK Run plugin key K\n"
|
"9R ^V Pick plugin xK Run plugin key K\n"
|
||||||
|
@ -3167,7 +3165,6 @@ static void populate(char *path, char *lastname)
|
||||||
if (!ndents)
|
if (!ndents)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!cfg.wild)
|
|
||||||
qsort(dents, ndents, sizeof(*dents), entrycmp);
|
qsort(dents, ndents, sizeof(*dents), entrycmp);
|
||||||
|
|
||||||
#ifdef DBGMODE
|
#ifdef DBGMODE
|
||||||
|
@ -3285,10 +3282,8 @@ static void redraw(char *path)
|
||||||
} else
|
} else
|
||||||
ncols -= 5;
|
ncols -= 5;
|
||||||
|
|
||||||
if (!cfg.wild) {
|
|
||||||
attron(COLOR_PAIR(cfg.curctx + 1) | A_BOLD);
|
attron(COLOR_PAIR(cfg.curctx + 1) | A_BOLD);
|
||||||
cfg.dircolor = 1;
|
cfg.dircolor = 1;
|
||||||
}
|
|
||||||
|
|
||||||
/* Print listing */
|
/* Print listing */
|
||||||
for (i = curscroll; i < ndents && i < curscroll + onscreen; ++i) {
|
for (i = curscroll; i < ndents && i < curscroll + onscreen; ++i) {
|
||||||
|
@ -3841,8 +3836,7 @@ nochange:
|
||||||
case SEL_ASIZE: // fallthrough
|
case SEL_ASIZE: // fallthrough
|
||||||
case SEL_BSIZE: // fallthrough
|
case SEL_BSIZE: // fallthrough
|
||||||
case SEL_EXTN: // fallthrough
|
case SEL_EXTN: // fallthrough
|
||||||
case SEL_MTIME: // fallthrough
|
case SEL_MTIME:
|
||||||
case SEL_WILD:
|
|
||||||
switch (sel) {
|
switch (sel) {
|
||||||
case SEL_MFLTR:
|
case SEL_MFLTR:
|
||||||
cfg.filtermode ^= 1;
|
cfg.filtermode ^= 1;
|
||||||
|
@ -3869,7 +3863,6 @@ nochange:
|
||||||
cfg.blkorder = 0;
|
cfg.blkorder = 0;
|
||||||
cfg.extnorder = 0;
|
cfg.extnorder = 0;
|
||||||
cfg.copymode = 0;
|
cfg.copymode = 0;
|
||||||
cfg.wild = 0;
|
|
||||||
break;
|
break;
|
||||||
case SEL_ASIZE:
|
case SEL_ASIZE:
|
||||||
cfg.apparentsz ^= 1;
|
cfg.apparentsz ^= 1;
|
||||||
|
@ -3896,7 +3889,6 @@ nochange:
|
||||||
cfg.sizeorder = 0;
|
cfg.sizeorder = 0;
|
||||||
cfg.extnorder = 0;
|
cfg.extnorder = 0;
|
||||||
cfg.copymode = 0;
|
cfg.copymode = 0;
|
||||||
cfg.wild = 0;
|
|
||||||
break;
|
break;
|
||||||
case SEL_EXTN:
|
case SEL_EXTN:
|
||||||
cfg.extnorder ^= 1;
|
cfg.extnorder ^= 1;
|
||||||
|
@ -3905,27 +3897,15 @@ nochange:
|
||||||
cfg.apparentsz = 0;
|
cfg.apparentsz = 0;
|
||||||
cfg.blkorder = 0;
|
cfg.blkorder = 0;
|
||||||
cfg.copymode = 0;
|
cfg.copymode = 0;
|
||||||
cfg.wild = 0;
|
|
||||||
break;
|
break;
|
||||||
case SEL_MTIME:
|
default: /* SEL_MTIME */
|
||||||
cfg.mtimeorder ^= 1;
|
cfg.mtimeorder ^= 1;
|
||||||
cfg.sizeorder = 0;
|
cfg.sizeorder = 0;
|
||||||
cfg.apparentsz = 0;
|
cfg.apparentsz = 0;
|
||||||
cfg.blkorder = 0;
|
cfg.blkorder = 0;
|
||||||
cfg.extnorder = 0;
|
cfg.extnorder = 0;
|
||||||
cfg.copymode = 0;
|
cfg.copymode = 0;
|
||||||
cfg.wild = 0;
|
|
||||||
break;
|
break;
|
||||||
default: /* SEL_WILD */
|
|
||||||
cfg.wild ^= 1;
|
|
||||||
cfg.mtimeorder = 0;
|
|
||||||
cfg.sizeorder = 0;
|
|
||||||
cfg.apparentsz = 0;
|
|
||||||
cfg.blkorder = 0;
|
|
||||||
cfg.extnorder = 0;
|
|
||||||
cfg.copymode = 0;
|
|
||||||
setdirwatch();
|
|
||||||
goto nochange;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save current */
|
/* Save current */
|
||||||
|
@ -4577,7 +4557,7 @@ static void usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stdout,
|
fprintf(stdout,
|
||||||
"%s: nnn [-b key] [-d] [-e] [-H] [-i] [-n] [-o]\n"
|
"%s: nnn [-b key] [-d] [-e] [-H] [-i] [-n] [-o]\n"
|
||||||
" [-p file] [-s] [-S] [-t] [-v] [-w] [-h] [PATH]\n\n"
|
" [-p file] [-s] [-S] [-t] [-v] [-h] [PATH]\n\n"
|
||||||
"The missing terminal file manager for X.\n\n"
|
"The missing terminal file manager for X.\n\n"
|
||||||
"positional args:\n"
|
"positional args:\n"
|
||||||
" PATH start dir [default: current dir]\n\n"
|
" PATH start dir [default: current dir]\n\n"
|
||||||
|
@ -4594,7 +4574,6 @@ static void usage(void)
|
||||||
" -S du mode\n"
|
" -S du mode\n"
|
||||||
" -t disable dir auto-select\n"
|
" -t disable dir auto-select\n"
|
||||||
" -v show version\n"
|
" -v show version\n"
|
||||||
" -w wild load\n"
|
|
||||||
" -h show help\n\n"
|
" -h show help\n\n"
|
||||||
"v%s\n%s\n", __func__, VERSION, GENERAL_INFO);
|
"v%s\n%s\n", __func__, VERSION, GENERAL_INFO);
|
||||||
}
|
}
|
||||||
|
@ -4725,7 +4704,7 @@ int main(int argc, char *argv[])
|
||||||
char *arg = NULL;
|
char *arg = NULL;
|
||||||
int opt;
|
int opt;
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "HSib:denop:stvwh")) != -1) {
|
while ((opt = getopt(argc, argv, "HSib:denop:stvh")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'S':
|
case 'S':
|
||||||
cfg.blkorder = 1;
|
cfg.blkorder = 1;
|
||||||
|
@ -4781,9 +4760,6 @@ int main(int argc, char *argv[])
|
||||||
case 'v':
|
case 'v':
|
||||||
fprintf(stdout, "%s\n", VERSION);
|
fprintf(stdout, "%s\n", VERSION);
|
||||||
return _SUCCESS;
|
return _SUCCESS;
|
||||||
case 'w':
|
|
||||||
cfg.wild = 1;
|
|
||||||
break;
|
|
||||||
case 'h':
|
case 'h':
|
||||||
usage();
|
usage();
|
||||||
return _SUCCESS;
|
return _SUCCESS;
|
||||||
|
|
|
@ -74,7 +74,6 @@ enum action {
|
||||||
SEL_BSIZE, /* block size */
|
SEL_BSIZE, /* block size */
|
||||||
SEL_EXTN, /* order by extension */
|
SEL_EXTN, /* order by extension */
|
||||||
SEL_MTIME,
|
SEL_MTIME,
|
||||||
SEL_WILD,
|
|
||||||
SEL_REDRAW,
|
SEL_REDRAW,
|
||||||
SEL_SEL,
|
SEL_SEL,
|
||||||
SEL_SELMUL,
|
SEL_SELMUL,
|
||||||
|
@ -199,8 +198,6 @@ static struct key bindings[] = {
|
||||||
{ 'E', SEL_EXTN },
|
{ 'E', SEL_EXTN },
|
||||||
/* Toggle sort by time */
|
/* Toggle sort by time */
|
||||||
{ 't', SEL_MTIME },
|
{ 't', SEL_MTIME },
|
||||||
/* Wild load */
|
|
||||||
{ CONTROL('W'), SEL_WILD },
|
|
||||||
/* Redraw window */
|
/* Redraw window */
|
||||||
{ CONTROL('L'), SEL_REDRAW },
|
{ CONTROL('L'), SEL_REDRAW },
|
||||||
/* Copy currently selected file path */
|
/* Copy currently selected file path */
|
||||||
|
|
Loading…
Reference in a new issue