Updated Live previews (markdown)

Mischievous Meerkat 2020-05-21 07:58:49 +05:30
parent ec17fc390f
commit 91cac9f296

@ -13,17 +13,21 @@ Both ways use the `NNN_FIFO` feature to get updated on cursor move.
### Setting up `NNN_FIFO`
Every plugins use `NNN_FIFO`, so it needs to be exported. You can either:
1. Globally export a FIFO path in, e.g., `.profile`:
~~~sh
export NNN_FIFO=/tmp/nnn.fifo
~~~
In that case every `nnn` instance will use the same FIFO, so a previewer plugin will get updated from every cursor move from any instance in the same window.
2. If you want to avoid that behaviour, you need to use a different FIFO path for every instance, e.g. with an alias:
~~~sh
alias nnn='NNN_FIFO="$(mktemp -u)" nnn'
~~~
Not that you don't need to create the FIFO file, `nnn` will create it itself.
1. Globally export a FIFO path in, e.g., `.profile`:
```sh
export NNN_FIFO=/tmp/nnn.fifo
```
This mechanism is suitable if you are using a single instance of `nnn`.
2. For multiple instances of `nnn`, use a different FIFO path for every instance, e.g. with an alias:
```sh
alias nnn='NNN_FIFO="$(mktemp -u)" nnn'
```
`nnn` will create the per-instance FIFO files.
### Using the plugin