]> Sergey Matveev's repositories - nnn.git/commitdiff
Update plugin docs and examples
authorArun Prakash Jana <engineerarun@gmail.com>
Mon, 2 Jan 2023 23:07:07 +0000 (04:37 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Mon, 2 Jan 2023 23:07:07 +0000 (04:37 +0530)
nnn.1
plugins/README.md

diff --git a/nnn.1 b/nnn.1
index 091a92af231b3d082d6a39a85347e76a46625f1e..7b736a25f82c787095e58fc78542af93cd6738f8 100644 (file)
--- a/nnn.1
+++ b/nnn.1
@@ -440,14 +440,15 @@ separated by \fI;\fR:
         export NNN_PLUG='y:-!sync*'
 
     6. To run a \fIGUI app as plugin\fR, add a \fB&\fR after \fB!\fR
-       Note: \fI$nnn\fR must be the last argument in this case.
+       \fI$nnn\fR must be the last argument in this case.
 
         export NNN_PLUG='m:-!&mousepad $nnn'
 
     7. To show the output of run-and-exit commands which do not need user input,
        add \fB|\fR (pipe) after \fB!\fR
        Note: This option is incompatible with \fB&\fR (terminal output is masked
-       for GUI programs) and ignores \fB*\fR (output is already paged for user)
+       for GUI programs) and ignores \fB*\fR (output is already paged for user).
+       \fI$nnn\fR must be the last argument in this case as well.
 
         export NNN_PLUG='m:-!|mediainfo $nnn;t:-!|tree -ps;l:-!|ls -lah --group-directories-first'
 
@@ -457,6 +458,7 @@ separated by \fI;\fR:
     ------------------------------------ + -------------------------------------------------
     c:!convert $nnn png:- | xclip -sel \ | Copy image to clipboard
        clipboard -t image/png*           |
+    C:!cp -rv "$nnn" "$nnn".cp*          | Create a copy of the hovered file
     e:-!sudo -E vim $nnn*                | Edit file as root in vim
     g:-!git diff                         | Show git diff
     h:-!hx $nnn*                         | Open hovered file in hx hex editor
index b7ef7d6bf94be0d8f7d12c8e3b781462bdca1728..ca5af90bdd5d786125dc718e501e94abf763df0a 100644 (file)
@@ -169,7 +169,7 @@ To run a GUI app as plugin, add a `&` after `!`.
 export NNN_PLUG='m:-!&mousepad $nnn'
 ```
 
-Note: `$nnn` must be the last argument in this case.
+`$nnn` must be the last argument in this case.
 
 #### Page non-interactive command output [`|`]
 
@@ -180,11 +180,12 @@ export NNN_PLUG='m:-!|mediainfo $nnn;t:-!|tree -ps;l:-!|ls -lah --group-director
 ```
 
 This option is incompatible with `&` (terminal output is masked for GUI programs) and ignores `*` (output is already paged for user).
+`$nnn` must be the last argument in this case as well.
 
 Notes:
 
 1. Use single quotes for `$NNN_PLUG` so `$nnn` is not interpreted
-2. `$nnn` must be the last argument (if used) to run a _command as plugin_
+2. `$nnn` must be the last argument (if used) to run a _GUI app as plugin_ or to page non-interactive command output
 3. (_Again_) add `!` before the command
 4. To disable directory refresh after running a _command as plugin_, prefix with `-!`
 
@@ -193,6 +194,7 @@ Notes:
 | Key:Command | Description |
 |---|---|
 | `c:!convert $nnn png:- \| xclip -sel clipboard -t image/png*` | Copy image to clipboard |
+| `C:!cp -rv "$nnn" "$nnn".cp` | Create a copy of the hovered file |
 | `e:-!sudo -E vim $nnn*` | Edit file as root in vim |
 | `g:-!git diff` | Show git diff |
 | `h:-!hx $nnn*` | Open hovered file in [hx](https://github.com/krpors/hx) hex editor |