nvim-tree.lua icon indicating copy to clipboard operation
nvim-tree.lua copied to clipboard

Floating window and preview

Open fragov opened this issue 3 years ago • 12 comments

Is there any chance to have nvim-tree in floating window with files preview in next versions?

fragov avatar Nov 17 '20 17:11 fragov

i don't think this is a goal i wish to acomplish, although it should be quite easy to do with the api i'll provide in the next version i'm working on.

kyazdani42 avatar Nov 18 '20 22:11 kyazdani42

+1 Unlike the splitting window, the floating window won't mess the window layout.

wkcosmology avatar Mar 06 '21 03:03 wkcosmology

Hi @kyazdani42, did you by any chance already add the

i don't think this is a goal i wish to acomplish, although it should be quite easy to do with the api i'll provide in the next version i'm working on.

Hi @kyazdani42, did you by chance already add the api you've mentioned?

defr0std avatar Mar 16 '21 08:03 defr0std

hi, haven't really had the time to refactor this part yet :)

kyazdani42 avatar Mar 16 '21 17:03 kyazdani42

Looking forward to this feature. I really miss this feature since switching from coc-explorer.

haphamdev avatar Aug 07 '21 01:08 haphamdev

Me too! coc-explorer is oddly the main thing keeping me from switching to neovim's native LSP 😅

stevenocchipinti avatar Aug 07 '21 01:08 stevenocchipinti

i guess i've rewritten the view handling enough so this can be tackled. something like extending the view.lua file to handle a popup view basically :) EDIT: with vim.api.nvim_open_win. I'm not sure the implication it would have on other modules but it should work the same (but maybe the open_file function would need some change too ?)

kyazdani42 avatar Aug 07 '21 17:08 kyazdani42

I would love that too, this is something that amazed me when I used coc-explorer and it's really missing from this great plugin. It would be great if you could add this 😃

tsakirist avatar Aug 11 '21 17:08 tsakirist

I tried to mess up with view.lua, but my LUA knowledge is almost zero. So I had to switch to lir. :(

fragov avatar Nov 03 '21 10:11 fragov

Tried 3 another file-tree plugins and Telescope explorer and I'm back again. Too many bugs and issues. Last one had an interesting choice of hotkeys: d for creating a directory, and shift-d to delete a folder (and it even didn't ask if you really want to delete that folder). I deleted my work for full day today.

What a good way to learn how I can extend nvim-tree? Any suggestions?

fragov avatar Jan 11 '22 22:01 fragov

hi @fragov sorry for the late answer. Well i believe the view should be refactored first before implementing this, i'm not sure it would be too easy to do in the current state of the plugin :) This will land at some point

kyazdani42 avatar Feb 05 '22 10:02 kyazdani42

@lu5je0 any chance you could put something together for this?

alex-courtis avatar Apr 11 '22 00:04 alex-courtis

Floating nvim-tree window has been implemented. :help nvim-tree.view.float.

It doesn't seem that floating preview has gained much interest. Please re-open / create a new PR if that's something you have a good use case for.

alex-courtis avatar Oct 23 '22 04:10 alex-courtis

I think floating-window is a good feature for nvim-tree. If I have two panels simultaneously, a floating window makes it easier to view the file explorer. Please keep supporting this feature. Thank you so much. image

lexuancuong avatar May 20 '23 05:05 lexuancuong

@lexuancuong it's implemented. See https://github.com/nvim-tree/nvim-tree.lua/issues/135#issuecomment-1288002079

gegoune avatar May 20 '23 07:05 gegoune

I implemented float preview. Example (asciinema preview may broken, please open link) asciicast Code available floatpreview.lua,nvimtree attach. Currently I don't know how to integrate with nvimtree code, but I try in future.

JMarkin avatar Jun 11 '23 22:06 JMarkin

Code available floatpreview.lua,nvimtree attach.

That's incredible! Can you please share this as a Recipe?

Currently I don't know how to integrate with nvimtree code, but I try in future.

That looks like it will fit nicely into open-file, minus the treesitter part ;)

Have a go, open a PR and we can help you.

alex-courtis avatar Jun 12 '23 05:06 alex-courtis

Hello all, I created PR and this plugin https://github.com/JMarkin/nvim-tree.lua-float-preview. May be to need only plugin and Recipe ? What do you think?

JMarkin avatar Jun 23 '23 05:06 JMarkin

Any official support ?

tracyone avatar Oct 20 '23 14:10 tracyone

Please accept my apologies @JMarkin, it was never added. It's present now: Extension Plugins

Please do update the page with a better description.

I hope you have a great experience with it @tracyone

alex-courtis avatar Oct 21 '23 01:10 alex-courtis

The nvim-tree-float-preview seems to be an amazing extension.

However, I'm unable to follow the installation instruction to get it work.

Hope @JMarkin can kindly elaborate on how it can be installed in the context of lazy.nvim and lazyvim with an example.

hopezh avatar Jan 04 '24 14:01 hopezh

@hopezh I think readme has example for lazy.nvim, for lazyvim I don't know

JMarkin avatar Jan 04 '24 20:01 JMarkin