Skip to content

Visual Customizations

cseickel edited this page Jan 12, 2022 · 3 revisions

This page is for changes to the look and feel of the plugin. Things like colors, dynamic sizing or positioning, etc.

Floating Window Settings

Float Right

This is a nice look where the sidebar will float to the right, positioned like a right hand sidebar but floating. One side effect of this layout is that it will automatically close the tree after you open a file.

NeoTreeFloat on right

      require("neo-tree").setup({
        filesystem = {
          window = {
            popup = {
              position = { col = "100%", row = "2" },
              size = function(state)
                local root_name = vim.fn.fnamemodify(state.path, ":~")
                local root_len = string.len(root_name) + 4
                return {
                  width = math.max(root_len, 50),
                  height = vim.o.lines - 6
                }
              end
            },
          }
        }
      })

The above configuration uses a function to return the size so the height can be adjusted. It will also dynamically change the width to show the entire root path if it is long.

Clone this wiki locally