Nnn: how use kitty plugin preview?

Created on 17 May 2020  路  25Comments  路  Source: jarun/nnn

in kitty config set option allow_remote_control yes
create /tmp/nnn.fifo
set NNN_FIFO=/tmp/nnn.fifo nnn
set NNN_PLUG='p:preview-kitty';
but not working
help me please

question

Most helpful comment

@midexe6380 I added a FIFO notify on exit in PR #581, this should fix your issue.

All 25 comments

I don't have kitty, but the other devs usually respond within 24hours.

Do any of the other preview plugins work at least (The idea is to figure out if NNN_FIFO is working correctly for you)

and most importantly, you probably have to be on master, I didn't read the PR for kitty support, but it's a good idea if you are checking out the bleeding edge features...

But hold out, preview has been the best thing we've implemented the past year if you ask me.

@midexe6380 what happens when you start the plugin (press ; than p), do you see a new kitty pane opening?

Basically try:

  1. NNN_FIFO=/tmp/nnn.fifo NNN_PLUG='p:preview-tui' nnn in any term emulator, then press ;p, if this doesn't work the issue is related to FIFO/preview stuff
  2. in kitty, try running kitty @ launch man man, if this doesn't open a new pane with a man page open, the issue is probably related to kitty config.

panel opens and closes immediately
(press ; than p)
https://youtu.be/TDSorSve9q8

my kitty.conf
https://termbin.com/1p72

command kitty @ launch man man is working (open new pane with man)

when i try run preview-tui

  1. NNN_FIFO=/tmp/nnn.fifo NNN_PLUG='p:preview-tui' nnn in any term emulator, then press ;p, if this doesn't work the issue is related to FIFO/preview stuff

https://i.imgur.com/wwan1G7.png

Stop. Should be on a master branch? I have 3.1 version.

@midexe6380 yes, the NNN_FIFO feature, needed for file preview support, was introduced 2 weeks ago.

I also think that you have NNN_FIFO pointed to a regular file (not a FIFO), just either remove the file (and nnn will create a FIFO for you), or create it with mkfifo.

is working now
but is not live previews
I can view only one file
https://i.imgur.com/7BZuRyk.png

OK, you probably fixed the FIFO file issue, now you'll need to update nnn to master (3.1 was released more than 2 weeks ago, so it doesn't include NNN_FIFO feature).

I'm suspecting he may believe preview means something else

2020-05-18_00-18-46

Is it not working like this?

image

If you need different behavior, chances are you have to re-program it for your needs. The current system is very versatile

Edit: clarification, in the gif i'm only pressing j to go down a file in nnn

is working now 馃槉
@0xACE
@leovilok
Thank you so much.

demo nnn and ranger preview
https://youtu.be/XwDYEfAo8YY

planning to create a key to automatically launch kitty plugin ?
like nnn --plugin=preview-kitty
not to press ; than p

planning to create a key to automatically launch kitty plugin ?

Not a bad idea. But you can also press Alt-P.

@midexe6380 check out program option -P at commit 1b5c3096caaa6cd903473a69ec0890f40a986967.

Closing the issue as it is resolved.

i use current kitty version 0.17.4
https://github.com/kovidgoyal/kitty/releases/tag/v0.17.4

plugin is working
but kitty preview function needs stabilization
because when you close nnn, the preview window does not always close
sometimes it closes sometimes no

as a result, the preview window remains open, while nnn is already closed

@midexe6380

but kitty preview function needs stabilization

Please raise an issue on kitty.

@midexe6380 oh, I guess it might never close if you never move the cursor, is it the issue?

@leovilok I don't understand what you mean

@midexe6380 in nnn, if you start the preview plugin to preview the hovered file, and then immediately exit nnn (so you never preview more than 1 file), I think that there is a case where the preview window stays open. (Because nnn never opened the write FIFO, so it never closes it)

@leovilok Do you think this is normal behavior nnn?

@midexe6380 no, it's a minor issue, but I just thought about it theorically, is it really the issue you're experiencing?

@leovilok I don't know. How to check it?

@leovilok I don't know. How to check it?

by hovering/clicking on another file. basically make sure you select a file AFTER the preview-plugin has started.

Because nnn doesn't send anything to nnn_fifo until after the preview-plugin has started

@midexe6380 I added a FIFO notify on exit in PR #581, this should fix your issue.

@midexe6380 the fix is now merged to master (commit https://github.com/jarun/nnn/commit/0c916ae7b024c961df1ab1797035ee80501f66e3)

@leovilok Amazing!
Thank you very much 馃檹
However kitty plugin needs to be stabilized https://github.com/jarun/nnn/issues/582

Was this page helpful?
0 / 5 - 0 ratings