mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 20:01:27 +00:00
Support launching cli utility too
This commit is contained in:
parent
b59a21b57e
commit
2d8afc8de7
10
README.md
10
README.md
|
@ -117,7 +117,7 @@ We need contributors. Please visit the ToDo list.
|
||||||
- Run custom scripts in the current directory
|
- Run custom scripts in the current directory
|
||||||
- Change directory at exit (*easy* shell integration)
|
- Change directory at exit (*easy* shell integration)
|
||||||
- Edit file in EDITOR or open in PAGER
|
- Edit file in EDITOR or open in PAGER
|
||||||
- GUI app launcher
|
- Application launcher
|
||||||
- Terminal locker integration
|
- Terminal locker integration
|
||||||
- Unicode support
|
- Unicode support
|
||||||
- Highly optimized, static analysis integrated code
|
- Highly optimized, static analysis integrated code
|
||||||
|
@ -244,7 +244,7 @@ Press <kbd>?</kbd> in `nnn` to see the list anytime.
|
||||||
^J Disk usage S Apparent du
|
^J Disk usage S Apparent du
|
||||||
s Size t Modification time
|
s Size t Modification time
|
||||||
MISC
|
MISC
|
||||||
o Launch GUI app !, ^] Spawn SHELL in dir
|
!, ^] Spawn SHELL in dir o Launch app
|
||||||
R Run custom script L Lock terminal
|
R Run custom script L Lock terminal
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -438,9 +438,13 @@ To get a space-separated list of the file paths in selection, say at the command
|
||||||
|
|
||||||
cat ~/.nnncp | xargs -0 echo
|
cat ~/.nnncp | xargs -0 echo
|
||||||
|
|
||||||
|
Set an easy to remember alias:
|
||||||
|
|
||||||
|
alias ncp="cat ~/.nnncp | xargs -0 echo"
|
||||||
|
|
||||||
To get the list in a file:
|
To get the list in a file:
|
||||||
|
|
||||||
cat ~/.nnncp | xargs -0 echo > out.txt
|
ncp > out.txt
|
||||||
|
|
||||||
#### cd on quit
|
#### cd on quit
|
||||||
|
|
||||||
|
|
4
nnn.1
4
nnn.1
|
@ -143,10 +143,10 @@ Toggle sort by time modified
|
||||||
MISC
|
MISC
|
||||||
.Pp
|
.Pp
|
||||||
.Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact
|
.Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact
|
||||||
.It Ic o
|
|
||||||
Launch a GUI application (takes 2 combined arguments)
|
|
||||||
.It Ic \&!, ^]
|
.It Ic \&!, ^]
|
||||||
Spawn SHELL in current directory (fallback sh)
|
Spawn SHELL in current directory (fallback sh)
|
||||||
|
.It Ic o
|
||||||
|
Launch an application (takes 2 combined arguments)
|
||||||
.It Ic R
|
.It Ic R
|
||||||
Run a custom script
|
Run a custom script
|
||||||
.It Ic L
|
.It Ic L
|
||||||
|
|
16
src/nnn.c
16
src/nnn.c
|
@ -2051,7 +2051,7 @@ static int show_help(char *path)
|
||||||
"d^J Disk usage S Apparent du\n"
|
"d^J Disk usage S Apparent du\n"
|
||||||
"es Size t Modification time\n"
|
"es Size t Modification time\n"
|
||||||
"1MISC\n"
|
"1MISC\n"
|
||||||
"eo Launch GUI app !, ^] Spawn SHELL in dir\n"
|
"a!, ^] Spawn SHELL in dir o Launch app\n"
|
||||||
"eR Run custom script L Lock terminal\n"};
|
"eR Run custom script L Lock terminal\n"};
|
||||||
|
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
|
@ -3221,13 +3221,13 @@ nochange:
|
||||||
goto nochange;
|
goto nochange;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sel == SEL_OPEN) {
|
r = get_input("press 'c' for cli mode");
|
||||||
r = get_input("press 'c' for cli mode");
|
if (r == 'c')
|
||||||
if (r == 'c')
|
r = F_NORMAL;
|
||||||
r = F_NORMAL;
|
else
|
||||||
else
|
r = F_NOWAIT | F_NOTRACE;
|
||||||
r = F_NOWAIT | F_NOTRACE;
|
|
||||||
|
|
||||||
|
if (sel == SEL_OPEN) {
|
||||||
getprogarg(tmp, &ptr);
|
getprogarg(tmp, &ptr);
|
||||||
mkpath(path, dents[cur].name, newpath, PATH_MAX);
|
mkpath(path, dents[cur].name, newpath, PATH_MAX);
|
||||||
spawn(tmp, ptr, newpath, path, r);
|
spawn(tmp, ptr, newpath, path, r);
|
||||||
|
@ -3254,7 +3254,7 @@ nochange:
|
||||||
++ptr;
|
++ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
spawn(tmp, ptr1, ptr2, path, F_NOWAIT | F_NOTRACE);
|
spawn(tmp, ptr1, ptr2, path, r);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue