mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Update copier script and docs
This commit is contained in:
parent
d1b4cc2beb
commit
5b42d9d8ea
17
README.md
17
README.md
|
@ -389,7 +389,7 @@ File paths are copied to the temporary file `DIR/.nnncp`, where `DIR` (by priori
|
||||||
$TMPDIR or,
|
$TMPDIR or,
|
||||||
/tmp
|
/tmp
|
||||||
|
|
||||||
To see the path to the temporary copy file, run `nnn`, press <kbd>?</kbd> and look up `copy file`.
|
The path is shown in the help and configuration screen..
|
||||||
|
|
||||||
To use the copied paths from the cmdline, use command substitution. For example, if `DIR` above is `/home/user`:
|
To use the copied paths from the cmdline, use command substitution. For example, if `DIR` above is `/home/user`:
|
||||||
|
|
||||||
|
@ -415,18 +415,9 @@ so you can easily handle files together:
|
||||||
|
|
||||||
##### to clipboard
|
##### to clipboard
|
||||||
|
|
||||||
Along with default copy, `nnn` can pipe the absolute path of the current file or multiple files to a copier script. For example, you can use `xsel` on Linux or `pbcopy` on OS X.
|
Along with default copy, `nnn` can pipe the absolute path of the current file or multiple files to a copier script. For example, you can use `xsel` on Linux or `pbcopy` on OS X. Here's a sample [copier script](https://github.com/jarun/nnn/tree/master/scripts/copier).
|
||||||
|
|
||||||
Sample Linux copier script:
|
To inform `nnn` of the executable copier script location:
|
||||||
|
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# comment the next line to convert newlines to spaces
|
|
||||||
IFS=
|
|
||||||
|
|
||||||
echo -n $1 | xsel --clipboard --input
|
|
||||||
|
|
||||||
export `NNN_COPIER`:
|
|
||||||
|
|
||||||
export NNN_COPIER="/path/to/copier.sh"
|
export NNN_COPIER="/path/to/copier.sh"
|
||||||
|
|
||||||
|
@ -490,7 +481,7 @@ Any other value disables colored directories.
|
||||||
|
|
||||||
#### integrate patool
|
#### integrate patool
|
||||||
|
|
||||||
On systems where `atool` is not available but `patool` is, drop two copies of the Python3 script [natool](https://github.com/jarun/nnn/blob/master/scripts/natool) as `atool` and `apack` somewhere in `$PATH`.
|
On systems where `atool` is not available but `patool` is, drop two copies of the Python3 script [natool](https://github.com/jarun/nnn/tree/master/scripts/natool) as `atool` and `apack` somewhere in `$PATH`.
|
||||||
|
|
||||||
#### work faster at rename prompt
|
#### work faster at rename prompt
|
||||||
|
|
||||||
|
|
12
nnn.1
12
nnn.1
|
@ -284,15 +284,11 @@ files.
|
||||||
.Pp
|
.Pp
|
||||||
\fBNNN_IDLE_TIMEOUT:\fR set idle timeout (in seconds) to invoke terminal locker.
|
\fBNNN_IDLE_TIMEOUT:\fR set idle timeout (in seconds) to invoke terminal locker.
|
||||||
.Pp
|
.Pp
|
||||||
\fBNNN_COPIER:\fR set to a clipboard copier script. For example, on Linux:
|
\fBNNN_COPIER:\fR set to a clipboard copier script.
|
||||||
.Bd -literal
|
.Bd -literal
|
||||||
-----------------------------------------
|
NOTE: By default file paths are copied to the tmp file \fBDIR/.nnncp\fR, where 'DIR' (by priority) is:
|
||||||
#!/bin/sh
|
\fI$HOME\fR or, \fI$TMPDIR\fR or, \fI/tmp\fR.
|
||||||
|
The path is shown in the help and configuration screen.
|
||||||
cat /path/to/.nnncp | xargs -0 | xsel -bi
|
|
||||||
-----------------------------------------
|
|
||||||
|
|
||||||
NOTE: By default file paths are copied to the tmp file \fBDIR/.nnncp\fR, where 'DIR' (by priority) is: \fI$HOME\fR or, \fI$TMPDIR\fR or, \fI/tmp\fR.
|
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
\fBNNN_SCRIPT:\fR path to a custom script to invoke with currently selected file name as argument 1.
|
\fBNNN_SCRIPT:\fR path to a custom script to invoke with currently selected file name as argument 1.
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
cat /path/to/.nnncp | xargs -0 | xsel -bi
|
# Linux
|
||||||
|
cat ~/.nnncp | xargs -0 | xsel -bi
|
||||||
|
|
||||||
|
# macOS
|
||||||
|
# cat ~/.nnncp | xargs -0 | pbcopy
|
||||||
|
|
||||||
# Termux
|
# Termux
|
||||||
# cat /path/to/.nnncp | xargs -0 | termux-clipboard-set
|
# cat /data/data/com.termux/files/home/.nnncp | xargs -0 | termux-clipboard-set
|
||||||
# e.g.: cat /data/data/com.termux/files/home/.nnncp | xargs -0 | termux-clipboard-set
|
|
||||||
|
# Cygwin
|
||||||
|
# cat ~/.nnncp | xargs -0 | clip
|
||||||
|
|
Loading…
Reference in a new issue