Skip to content

Persist the "filter options" over the session lifecycle #3186

@zozowell

Description

@zozowell

hey nvim-tree builders,

I would like to raise a small feature request to you, which may increase the nvim-tree UX a bit, just for your reference. Thanks a lot for building this useful tool.

Is this a question?
No

Can this functionality be implemented utilising API?
I'm not very sure about this, but with a preliminary search in the API, I didn't find a very straight-forward way to implement it.

Is your feature request related to a problem? Please describe.

I set the nvim-tree to update root dir following the buffer switch, I often switch back and forth between two git projects which have different root ofc. The default setting recognizes .gitignore, so, in a project, if I need to inspect some git ignored files, I have to turn off the ignore filter by I key, navigate to the ignored directory and open the target file. But quickly, I ran into two problems:

  • When I switch to another file in a different root dir, then switch back later, I expected the tree view is exactly the same as I left it, i.e. a view showing all ignore dirs/files are still there and focus follows my opened file, it means my previous filter toggle is still functioning. However, they are all gone, i have to toggle ignore filter again to show those ignored files.
  • After I toggle ignore filter again, the tree-view didn't refresh to follow the opened file automatically, I have to navigate to the deep dir which contains that file...
      update_focused_file = {
        enable = true,
        update_root = {
          enable = true,
          ignore_list = {},
        },
        exclude = false,
      },

Describe the solution you'd like

  • The filter options can persist across root dir switchs, and be a session level setting.
  • Once set, it can apply on all the root dirs you switch to.
  • The tree focus can follow the files on the ignore list, only if you turn off the ignore filter for current session.
  • The setting doesn't change the default settings, in a new vim session, all the filter option changes are gone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR pleasenvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciatedQOLQuality Of Life Improvementfeature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions