aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-02-24 08:33:22 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-02-24 08:56:44 +0530
commitd0a08ca173012888fb83d5f1981a38b05ea3c40c (patch)
treeaf2ca347ebd926b1755d0ef633690da3762a927d
parentb22d8c32f9657124a5d67db9e62aa30e704e583e (diff)
downloadnnn-d0a08ca173012888fb83d5f1981a38b05ea3c40c.tar.gz
Document file path copy usage sans clipboard
-rw-r--r--README.md29
-rw-r--r--nnn.15
2 files changed, 34 insertions, 0 deletions
diff --git a/README.md b/README.md
index 7dbc668..7a567ed 100644
--- a/README.md
+++ b/README.md
@@ -68,6 +68,7 @@ Have fun with it! PRs are welcome. Check out [#1](https://github.com/jarun/nnn/i
- [use cd .....](#use-cd-)
- [cd on quit](#cd-on-quit)
- [copy file paths to clipboard](#copy-file-paths-to-clipboard)
+ - [copy file paths when X is missing](#copy-file-paths-when-x-is-missing)
- [change dir color](#change-dir-color)
- [file copy, move, delete](#file-copy-move-delete)
- [boost chdir prompt](#boost-chdir-prompt)
@@ -376,6 +377,34 @@ To wrap each file path within single quotes, export `NNN_QUOTE_ON`:
export NNN_QUOTE_ON=1
This is particularly useful if you are planning to copy the whole string to the shell to run a command. Quotes can be toggled at runtime using <kbd>^T</kbd>.
+#### copy file paths when X is missing
+
+A very common scenario on headless remote servers connected via SSH. As the clipboard is missing, `nnn` copies the path names to the tmp file `/tmp/nnncp`.
+
+To use the copied paths from the cmdline, use command substitution:
+
+ # bash/zsh
+ ls -ltr `cat /tmp/nnncp`
+ ls -ltr $(cat /tmp/nnncp)
+
+ # fish
+ ls -ltr (cat /tmp/nnncp)
+
+An alias may be handy:
+
+ alias ncp='cat /tmp/nnncp'
+
+so you can -
+
+ # bash/zsh
+ ls -ltr `ncp`
+ ls -ltr $(ncp)
+
+ # fish
+ ls -ltr (ncp)
+
+Note that you may want to keep quotes disabled in this case.
+
#### change dir color
The default color for directories is blue. Option `-c` accepts color codes from 0 to 7 to use a different color:
diff --git a/nnn.1 b/nnn.1
index 9893184..d895828 100644
--- a/nnn.1
+++ b/nnn.1
@@ -245,6 +245,11 @@ screensaver.
-------------------------------------
.Ed
.Pp
+\fBNNN_NO_X:\fR X display is unavailable. Copy file path(s) to \fI/tmp/nnncp\fR.
+.Bd -literal
+ export NNN_NO_X=1
+.Ed
+.Pp
\fBNNN_NOWAIT:\fR necessary only if nnn blocks while a file is open.
.Bd -literal
export NNN_NOWAIT=1