Updated Live previews (markdown)

Mischievous Meerkat 2020-05-21 08:22:02 +05:30
parent 9d5c58ba8b
commit 63481b3c48
1 changed files with 5 additions and 5 deletions

@ -1,18 +1,18 @@
# Live previews
A live preview is a window that shows information about whatever file or directory `nnn` has highlighted. As the cursor moves, the live preview window will automatically update.
A live preview is a window that renders or shows information on the hovered file or directory. As the cursor moves, the live preview window will automatically update.
There are two ways to enable live previews in `nnn`:
1. using a previewer plugin,
2. using a custom wrapper/previewer script.
Both ways use the `NNN_FIFO` feature to get updated on cursor move.
Both use the path in `NNN_FIFO` to get hover updates.
## Previewer plugins
### Setting up `NNN_FIFO`
Previewer plugins use `NNN_FIFO`. There are 2 ways to export it:
There are 2 ways to export it based on the use case:
1. Globally export a FIFO path in, e.g., `.profile`:
@ -31,9 +31,9 @@ Previewer plugins use `NNN_FIFO`. There are 2 ways to export it:
### Using the plugin
Follow instructions nnn plugins' [README](https://github.com/jarun/nnn/tree/master/plugins) page on how to install and use plugins.
Follow the instructions in the `nnn` plugins' [README](https://github.com/jarun/nnn/tree/master/plugins) page on how to install and use plugins.
There are currently 3 previewer plugins for `nnn`, using various technology to display the preview window:
There are 3 previewer plugins for `nnn`, using various mechanisms to display the preview window:
- [preview-kitty](https://github.com/jarun/nnn/blob/master/plugins/preview-kitty): the preview window is a [kitty](https://sw.kovidgoyal.net/kitty/) pane (needs kitty's allow_remote_control option turned on), and files are previewed using text tools ([exa](https://github.com/ogham/exa) or ls, [bat](https://github.com/sharkdp/bat) or cat, mediainfo or file, kitty's icat).
- [preview-tabbed](https://github.com/jarun/nnn/blob/master/plugins/preview-tabbed): the preview window is a [tabbed](https://tools.suckless.org/tabbed) X window, files are viewed using Xembed capable programs ([mpv](https://mpv.io) for audio/video, [sxiv](https://github.com/muennich/sxiv) for images, [zathura](https://pwmt.org/projects/zathura) for PDF, xterm/urxvt/st + [nuke](https://github.com/jarun/nnn/blob/master/plugins/nuke) plugin text preview for other files)