kelly-lin/ranger.nvim

[Feature Request] Allow for opening `ranger` in a floating window instead of default fullscreen

kohane27 opened this issue · 5 comments

Hello there. Hope you're doing well. Thank you for creating ranger-nvim; it's the best ranger plugin for me.

As titled, I'd like the feature to open ranger in a floating window instead of default fullscreen, like below:

2023-07-28-15-22-56

The above is achieved by using another plugin that supports ranger called fm-nvim. The following config is inspired by fm-nvim and maybe it can serve as a starting point?

require("ranger-nvim").setup({
  ui = {
    -- Default UI ("full" or "float")
    default = "float",

    float = {
      -- Floating window border (see ':h nvim_open_win')
      border = "none",

      -- Highlight group for floating window/border (see ':h winhl')
      float_hl = "Normal",
      border_hl = "FloatBorder",

      -- Floating Window Transparency (see ':h winblend')
      blend = 0,

      -- Num from 0 - 1 for measurements
      height = 0.8,
      width = 0.8,

      -- X and Y Axis of Window
      x = 0.5,
      y = 0.5,
    },
  },
})

Any input is much appreciated. Thank you!

Hey Kohane,

Thanks for the feature request and I am happy that the plug-in is serving your needs.

Sounds like a good idea, I am happy to add in the feature. I will make it an opt in feature with the current behaviour as the default behaviour.

I will add it on my todo list. I will close this issue when I have implemented this feature.

Thanks.

Hello @kelly-lin , hope you're doing well.

I just forked and did a quick proof-of-concept here: kohane27@3a5d241

2023-07-29-15-35-55

It works flawlessly and is almost one-to-one copy from fm-nvim. Hope it serves as a starting point. Thank you again!

Thanks @kohane27! Nice work!

@kohane27 I have implemented the feature with a few changes from your proposal in the latest commit 03819b53.

Thank you for your suggestion and help!

I have just tested and it works perfectly! Thank you so much!