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

How to change the size of floating window of the preview feature(`use_float = true`)

Open nyngwang opened this issue 3 years ago • 5 comments

As title. I assume this can be set inside the ['P'] = { 'toggle_preview', config = { ... } }.

nyngwang avatar Sep 20 '22 16:09 nyngwang

It's not actually configurable yet. It's hard coded to 120 or available remaining space when it is opened from a sidebar, or the width of the Neo-tree window if opening from a bottom/top window (which you would likely use for the diagnostics extension)

cseickel avatar Sep 20 '22 16:09 cseickel

Happy to wait for the customization options(since I love customizing floating windows :P), but you don't need to do this in a hurry! (reasons below)


@cseickel Well, I just realized the current default (by removing the config = { use_float = true} part) just fits my need(my imagination on the usage)! In my use case, I will open a lot of windows under current (neo)vim tab, and it's quite cumbersome to know whether certain file would look nice when put it under the current window split (say I mis-open a file on a split, I will need to kill the buffer, so one more step during the redo) but the current default just work:

In the demo the preview occupies the last window where I move my cursor into neo-tree. This is intuitive!

https://user-images.githubusercontent.com/24765272/191318695-3162a8f4-9220-4497-adcd-e72f0c59ed59.mov

nyngwang avatar Sep 20 '22 16:09 nyngwang

i use this config:

          window = {
            position = "float",
            popup = { -- settings that apply to float position only
              size = { height = "17", width = "45" },
              position = "50%", -- 50% means center it
            },
          },

dobbbri avatar Oct 22 '22 23:10 dobbbri

@dobbbri It will be nice to format your multi-line codes within a pair of triple back-quotes: ```

nyngwang avatar Nov 21 '22 01:11 nyngwang

i use this config:

          window = {
            position = "float",
            popup = { -- settings that apply to float position only
              size = { height = "17", width = "45" },
              position = "50%", -- 50% means center it
            },
          },

this solution worked beautifully.

fcancelinha avatar Sep 07 '23 19:09 fcancelinha