.Ed
.Pp
To assign keys to arbitrary non-background cli commands and invoke like
- plugins, add \fI!\fR before the command.
+ plugins, add \fB!\fR before the command.
.Bd -literal
export NNN_PLUG='x:!chmod +x $nnn;g:!git log;s:!smplayer $nnn'
- A keybinding definition of more than 1 character will prevent nnn from starting.
-#### Skip directory refresh after running a plugin
+#### Skip directory refresh after running a plugin [`-`]
`nnn` refreshes the directory after running a plugin to reflect any changes by the plugin. To disable this add a `-` before the plugin name:
export NNN_PLUG='p:-plugin'
```
-## Running commands as plugin
+## Running commands as plugin [`!`]
To assign keys to arbitrary non-background cli commands and invoke like plugins, add `!` (underscore) before the command.
Now <kbd>;x</kbd> can be used to make a file executable, <kbd>;g</kbd> can be used to the git log of a git project directory, <kbd>;s</kbd> can be used to preview a partially downloaded media file.
-#### Skip user confirmation after command execution
+#### Skip user confirmation after command execution [`*`]
`nnn` waits for user confirmation (the prompt `Press Enter to continue`) after it executes a command as plugin (unlike plugins which can add a `read` to wait). To skip this, add a `*` after the command.
Note: Do not use `*` with programs those run and exit e.g. cat.
-#### Run a GUI app as plugin
+#### Run a GUI app as plugin [`&`]
To run a GUI app as plugin, add a `&` after `!`.
Note: `$nnn` must be the last argument in this case.
-#### Page non-interactive command output
+#### Page non-interactive command output [`|`]
To show the output of run-and-exit commands which do not need user input, add `|` (pipe) after `!`.
The optional `-` at the **beginning of the stream** instructs `nnn` to clear the selection.
In cases where the data transfer to `nnn` has to happen while the selection file is being read (e.g. in a loop), the plugin should
create a tmp copy of the selection file, inform `nnn` to clear the selection and then do the subsequent processing with the tmp file.
+A paged [`|`] or GUI [`&`] cmd run as plugin cannot clear selection.
The `ctxcode` indicates the context to change the active directory of.