Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Ignore certain filetypes #17

Closed
shaun-mathew opened this issue Aug 9, 2022 · 4 comments
Closed

Feature Request: Ignore certain filetypes #17

shaun-mathew opened this issue Aug 9, 2022 · 4 comments

Comments

@shaun-mathew
Copy link

Sometimes I close Neovim with NvimTree or Trouble open and upon loading the Session, an empty NvimTree buffer and a pane is created to the side. It would be a nice feature if we could ignore certain filetypes when saving sessions.

Screenshot
After loading session:
nvimtree

@olimorris
Copy link
Owner

Hey @shaun-mathew. Have you looked at implementing your own custom callbacks? I use them to stop minimap being recorded into my session.

@shaun-mathew
Copy link
Author

Yep, I added something like this to my config that gets the job done:

config = function()
  require("persisted").setup {
    autosave = true,
    before_save = function()
      vim.cmd "NvimTreeClose"
    end,
  }
end

I was just wondering if what I suggested would be possible as a sort of convenience method where the user could specify a list of filetypes and before saving the session, the plugin could go around closing all windows with that filetype. Although, I assume it would get a bit messy.

@olimorris
Copy link
Owner

The reason for adding the callbacks was mainly because I was seeing a lot of singular edge cases crop up that if addressed directly in the plugin, would move it further away from being a "simple session management" plugin.

I ultimately see the callbacks as the plugin's admission that it will never be able to cater for everyone's use cases and therefore it should give the user the ability to dictate how it functions for their given workflow.

@KevinNitroG
Copy link

Hi ouhm 😅 I'm in trouble with this issue. Is there any config that ignores the window and the buffer of nvim-tree? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants