mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 21:36:42 +00:00
Update plugin docs and examples
This commit is contained in:
parent
c9b384f009
commit
dd214c50f3
6
nnn.1
6
nnn.1
|
@ -440,14 +440,15 @@ separated by \fI;\fR:
|
||||||
export NNN_PLUG='y:-!sync*'
|
export NNN_PLUG='y:-!sync*'
|
||||||
|
|
||||||
6. To run a \fIGUI app as plugin\fR, add a \fB&\fR after \fB!\fR
|
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'
|
export NNN_PLUG='m:-!&mousepad $nnn'
|
||||||
|
|
||||||
7. To show the output of run-and-exit commands which do not need user input,
|
7. To show the output of run-and-exit commands which do not need user input,
|
||||||
add \fB|\fR (pipe) after \fB!\fR
|
add \fB|\fR (pipe) after \fB!\fR
|
||||||
Note: This option is incompatible with \fB&\fR (terminal output is masked
|
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'
|
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
|
c:!convert $nnn png:- | xclip -sel \ | Copy image to clipboard
|
||||||
clipboard -t image/png* |
|
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
|
e:-!sudo -E vim $nnn* | Edit file as root in vim
|
||||||
g:-!git diff | Show git diff
|
g:-!git diff | Show git diff
|
||||||
h:-!hx $nnn* | Open hovered file in hx hex editor
|
h:-!hx $nnn* | Open hovered file in hx hex editor
|
||||||
|
|
|
@ -169,7 +169,7 @@ To run a GUI app as plugin, add a `&` after `!`.
|
||||||
export NNN_PLUG='m:-!&mousepad $nnn'
|
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 [`|`]
|
#### 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).
|
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:
|
Notes:
|
||||||
|
|
||||||
1. Use single quotes for `$NNN_PLUG` so `$nnn` is not interpreted
|
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
|
3. (_Again_) add `!` before the command
|
||||||
4. To disable directory refresh after running a _command as plugin_, prefix with `-!`
|
4. To disable directory refresh after running a _command as plugin_, prefix with `-!`
|
||||||
|
|
||||||
|
@ -193,6 +194,7 @@ Notes:
|
||||||
| Key:Command | Description |
|
| Key:Command | Description |
|
||||||
|---|---|
|
|---|---|
|
||||||
| `c:!convert $nnn png:- \| xclip -sel clipboard -t image/png*` | Copy image to clipboard |
|
| `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 |
|
| `e:-!sudo -E vim $nnn*` | Edit file as root in vim |
|
||||||
| `g:-!git diff` | Show git diff |
|
| `g:-!git diff` | Show git diff |
|
||||||
| `h:-!hx $nnn*` | Open hovered file in [hx](https://github.com/krpors/hx) hex editor |
|
| `h:-!hx $nnn*` | Open hovered file in [hx](https://github.com/krpors/hx) hex editor |
|
||||||
|
|
Loading…
Reference in a new issue