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

Feature Request: Auto Width or Full Name Under Cursor

Open jjiangweilan opened this issue 2 years ago • 1 comments

Hi thanks for the awesome work! I just switched from nvim-tree. And I think nvim-tree has one feature I use but I did't find here is the auto width of the explore. I have projects that use really deep folder hierarchy. The files are easily out of the explorer region which makes it hard to navigate and read. I have read the docs and only see "fit_content" for container which I think itn't what I want here.

jjiangweilan avatar Sep 28 '22 07:09 jjiangweilan

[...] The files are easily out of the explorer region which makes it hard to navigate and read. [...]

I also encountered this and found it annoying. Maybe showing a one-word height horizontal floating window for showing the full name could be a cool idea for implementing this.

nyngwang avatar Sep 28 '22 10:09 nyngwang

Hi, just wanted to announce that we now have an auto width expand option added! (details: #580 and #629)

It has been ported to v2.x branch and seems to be stable enough.

This feature is accessible via two ways.

  1. Adding the following option to the configuration. This makes neotree always expand to fit the longest line.
require("neo-tree").setup({
  window = {
    auto_expand_width = true, -- default: false
  },
})
  1. Alternatively, there is a keybind e that toggles the above option. IMO the best way to go is to keep window.auto_expand_width = false and toggle the feature whenever needed with this keybind.

I really wanted to add the floating window feature as well, but unfortunately I haven't got any knowledge on floating window management so I would really appreciate if someone could implement this feature as well :)

pysan3 avatar Dec 03 '22 18:12 pysan3

@pysan3 I'm using it :) Thanks for implementing this feature!

btw, you forgot to mention in 2.(while you're recommending it) that the toggle is named toggle_auto_expand_width. (since I have use_default_mappings = false,).

nyngwang avatar Dec 03 '22 19:12 nyngwang

Closing this as solved.

nhat-vo avatar Apr 09 '23 13:04 nhat-vo