mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
remove program option -f
This commit is contained in:
parent
5b0b63e7d6
commit
95f530854d
|
@ -18,7 +18,6 @@ _nnn ()
|
||||||
-d
|
-d
|
||||||
-e
|
-e
|
||||||
-E
|
-E
|
||||||
-f
|
|
||||||
-g
|
-g
|
||||||
-H
|
-H
|
||||||
-i
|
-i
|
||||||
|
|
|
@ -17,7 +17,6 @@ complete -c nnn -s c -d 'cli-only opener'
|
||||||
complete -c nnn -s d -d 'start in detail mode'
|
complete -c nnn -s d -d 'start in detail mode'
|
||||||
complete -c nnn -s e -r -d 'load session by name' -x -a '@\t"last session" (ls $sessions_dir)'
|
complete -c nnn -s e -r -d 'load session by name' -x -a '@\t"last session" (ls $sessions_dir)'
|
||||||
complete -c nnn -s E -d 'use EDITOR for undetached edits'
|
complete -c nnn -s E -d 'use EDITOR for undetached edits'
|
||||||
complete -c nnn -s f -d 'run filter as cmd on prompt key'
|
|
||||||
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 i -d 'start in navigate-as-you-type mode'
|
complete -c nnn -s i -d 'start in navigate-as-you-type mode'
|
||||||
|
|
|
@ -15,7 +15,6 @@ args=(
|
||||||
'(-d)-d[start in detail mode]'
|
'(-d)-d[start in detail mode]'
|
||||||
'(-e)-e[load session]:session name'
|
'(-e)-e[load session]:session name'
|
||||||
'(-E)-E[use EDITOR for undetached edits]'
|
'(-E)-E[use EDITOR for undetached edits]'
|
||||||
'(-f)-f[run filter as cmd on prompt key]'
|
|
||||||
'(-g)-g[regex filters]'
|
'(-g)-g[regex filters]'
|
||||||
'(-H)-H[show hidden files]'
|
'(-H)-H[show hidden files]'
|
||||||
'(-i)-i[start in navigate-as-you-type mode]'
|
'(-i)-i[start in navigate-as-you-type mode]'
|
||||||
|
|
8
nnn.1
8
nnn.1
|
@ -12,7 +12,6 @@
|
||||||
.Op Ar -d
|
.Op Ar -d
|
||||||
.Op Ar -e name
|
.Op Ar -e name
|
||||||
.Op Ar -E
|
.Op Ar -E
|
||||||
.Op Ar -f
|
|
||||||
.Op Ar -g
|
.Op Ar -g
|
||||||
.Op Ar -H
|
.Op Ar -H
|
||||||
.Op Ar -i
|
.Op Ar -i
|
||||||
|
@ -62,9 +61,6 @@ supports the following options:
|
||||||
.Fl E
|
.Fl E
|
||||||
use $EDITOR for internal undetached edits
|
use $EDITOR for internal undetached edits
|
||||||
.Pp
|
.Pp
|
||||||
.Fl f
|
|
||||||
run filter as command when the prompt key is pressed
|
|
||||||
.Pp
|
|
||||||
.Fl g
|
.Fl g
|
||||||
use regex filters instead of substring match
|
use regex filters instead of substring match
|
||||||
.Pp
|
.Pp
|
||||||
|
@ -148,14 +144,12 @@ with a '^' (caret) symbol.
|
||||||
.br
|
.br
|
||||||
(3) Use '.*' to match any character (\fIsort of\fR fuzzy search).
|
(3) Use '.*' to match any character (\fIsort of\fR fuzzy search).
|
||||||
.Pp
|
.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,
|
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,
|
When there's a unique match and it's a directory,
|
||||||
.Nm
|
.Nm
|
||||||
auto selects the directory and enters it in this mode.
|
auto selects the directory and enters it in this mode. Use the relevant program option to disable this behaviour.
|
||||||
.Sh SELECTION
|
.Sh SELECTION
|
||||||
There are 3 groups of keybinds to add files to selection:
|
There are 3 groups of keybinds to add files to selection:
|
||||||
.Pp
|
.Pp
|
||||||
|
|
36
src/nnn.c
36
src/nnn.c
|
@ -227,9 +227,8 @@ typedef struct {
|
||||||
uint selmode : 1; /* Set when selecting files */
|
uint selmode : 1; /* Set when selecting 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 : 2;
|
uint reserved : 3;
|
||||||
/* The following settings are global */
|
/* The following settings are global */
|
||||||
uint x11 : 1; /* Copy to system clipboard and show notis */
|
|
||||||
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 */
|
||||||
uint picker : 1; /* Write selection to user-specified file */
|
uint picker : 1; /* Write selection to user-specified file */
|
||||||
|
@ -241,7 +240,7 @@ 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 filtercmd : 1; /* Run filter as command on no match */
|
uint x11 : 1; /* Copy to system clipboard and show notis */
|
||||||
uint trash : 1; /* Move removed files to trash */
|
uint trash : 1; /* Move removed files to trash */
|
||||||
uint mtime : 1; /* Use modification time (else access time) */
|
uint mtime : 1; /* Use modification time (else access time) */
|
||||||
uint cliopener : 1; /* All-CLI app opener */
|
uint cliopener : 1; /* All-CLI app opener */
|
||||||
|
@ -282,7 +281,6 @@ static settings cfg = {
|
||||||
0, /* showdetail */
|
0, /* showdetail */
|
||||||
1, /* ctxactive */
|
1, /* ctxactive */
|
||||||
0, /* reserved */
|
0, /* reserved */
|
||||||
0, /* x11 */
|
|
||||||
0, /* curctx */
|
0, /* curctx */
|
||||||
0, /* dircolor */
|
0, /* dircolor */
|
||||||
0, /* picker */
|
0, /* picker */
|
||||||
|
@ -294,7 +292,7 @@ static settings cfg = {
|
||||||
0, /* runplugin */
|
0, /* runplugin */
|
||||||
0, /* runctx */
|
0, /* runctx */
|
||||||
0, /* filter_re */
|
0, /* filter_re */
|
||||||
0, /* filtercmd */
|
0, /* x11 */
|
||||||
0, /* trash */
|
0, /* trash */
|
||||||
1, /* mtime */
|
1, /* mtime */
|
||||||
0, /* cliopener */
|
0, /* cliopener */
|
||||||
|
@ -2058,28 +2056,10 @@ static int filterentries(char *path)
|
||||||
|
|
||||||
if (r == OK) {
|
if (r == OK) {
|
||||||
/* Handle all control chars in main loop */
|
/* Handle all control chars in main loop */
|
||||||
if ((*ch < ASCII_MAX && keyname(*ch)[0] == '^' && *ch != '^')
|
if (*ch < ASCII_MAX && keyname(*ch)[0] == '^' && *ch != '^') {
|
||||||
|| (*ch == ']' && len == 1)) {
|
|
||||||
DPRINTF_D(*ch);
|
DPRINTF_D(*ch);
|
||||||
DPRINTF_S(keyname(*ch));
|
DPRINTF_S(keyname(*ch));
|
||||||
|
|
||||||
/* If there's a filter, try a command on ^P */
|
|
||||||
if (cfg.filtercmd && *ch == CONTROL('P') && len > 1) {
|
|
||||||
prompt_run(pln, (ndents ? dents[cur].name : ""), path);
|
|
||||||
|
|
||||||
/* Clear the prompt */
|
|
||||||
while (len > 1)
|
|
||||||
wln[--len] = '\0';
|
|
||||||
wcstombs(ln, wln, REGEX_MAX);
|
|
||||||
ndents = total;
|
|
||||||
cur = oldcur = 0; /* Ran a command, refresh */
|
|
||||||
if (matches(pln) != -1)
|
|
||||||
redraw(path);
|
|
||||||
|
|
||||||
printprompt(ln);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (len == 1)
|
if (len == 1)
|
||||||
cur = oldcur;
|
cur = oldcur;
|
||||||
goto end;
|
goto end;
|
||||||
|
@ -3497,7 +3477,7 @@ static void show_help(const char *path)
|
||||||
"cC Execute file i ^V Pick plugin\n"
|
"cC Execute file i ^V Pick plugin\n"
|
||||||
"cs Manage session = Launch app\n"
|
"cs Manage session = Launch app\n"
|
||||||
"cc Connect remote u Unmount\n"
|
"cc Connect remote u Unmount\n"
|
||||||
"9] ^P Prompt/run cmd L Lock\n"};
|
"9] ^P Prompt L Lock\n"};
|
||||||
|
|
||||||
fd = create_tmp_file();
|
fd = create_tmp_file();
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
|
@ -5443,7 +5423,6 @@ static void usage(void)
|
||||||
" -d detail mode\n"
|
" -d detail mode\n"
|
||||||
" -e name load session by name\n"
|
" -e name load session by name\n"
|
||||||
" -E use EDITOR for undetached edits\n"
|
" -E use EDITOR for undetached edits\n"
|
||||||
" -f run filter as cmd on prompt key\n"
|
|
||||||
" -g regex filters [default: string]\n"
|
" -g regex filters [default: string]\n"
|
||||||
" -H show hidden files\n"
|
" -H show hidden files\n"
|
||||||
" -i nav-as-you-type mode\n"
|
" -i nav-as-you-type mode\n"
|
||||||
|
@ -5599,7 +5578,7 @@ int main(int argc, char *argv[])
|
||||||
bool progress = FALSE;
|
bool progress = FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "HSKiab:cde:Efgnop:rRtvxh")) != -1) {
|
while ((opt = getopt(argc, argv, "HSKiab:cde:Egnop:rRtvxh")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'S':
|
case 'S':
|
||||||
cfg.blkorder = 1;
|
cfg.blkorder = 1;
|
||||||
|
@ -5627,9 +5606,6 @@ int main(int argc, char *argv[])
|
||||||
case 'E':
|
case 'E':
|
||||||
cfg.waitedit = 1;
|
cfg.waitedit = 1;
|
||||||
break;
|
break;
|
||||||
case 'f':
|
|
||||||
cfg.filtercmd = 1;
|
|
||||||
break;
|
|
||||||
case 'g':
|
case 'g':
|
||||||
cfg.filter_re = 1;
|
cfg.filter_re = 1;
|
||||||
filterfn = &visible_re;
|
filterfn = &visible_re;
|
||||||
|
|
Loading…
Reference in a new issue