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] Add the ability to retain the open/closed status of the fern drawer between tabpages #469

Open
ydzhou opened this issue Mar 16, 2023 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed maybe oneday Things maybe implemented oneday

Comments

@ydzhou
Copy link
Contributor

ydzhou commented Mar 16, 2023

We can provide a feature to mimic the behaviour of a typical IDE's file explorer.

If I open a Fern drawer in current tab, and then I switch to other tab, the Fern drawer will automatically toggle to open, and vice versa. nvim-tree has a very similar feature.

@Shougo
Copy link

Shougo commented Mar 16, 2023

Why the feature is needed?
This feature is so useful?
I think mimic the behavior of IDE is not the reason.

@ydzhou
Copy link
Contributor Author

ydzhou commented Mar 16, 2023

It is a common feature, similar to (or a simplified version of) vim-nerdtree-tabs or nvim-tree.tab.sync. This new feature can save a lot of time to toggle on/off Fern across tabs.

For example, without this feature, if I do open in new tab, then in the new tab, I need to toggle Fern again to see my files and continue explore. I may do open in new tab again, then I need to toggle Fern again.

I previously proposed a feature about universal fern, but then now I realize I do not need a single global Fern in every tabs, I just need Fern always show up or always close for every tabs.

@lambdalisue lambdalisue added the enhancement New feature or request label Mar 16, 2023
@lambdalisue lambdalisue changed the title [feature] globally toggle Fern [Feature] Add the ability to retain the open/closed status of the fern drawer between tabbed pages Mar 16, 2023
@lambdalisue lambdalisue changed the title [Feature] Add the ability to retain the open/closed status of the fern drawer between tabbed pages [Feature] Add the ability to retain the open/closed status of the fern drawer between tabpages Mar 16, 2023
@lambdalisue lambdalisue added help wanted Extra attention is needed maybe oneday Things maybe implemented oneday labels Mar 16, 2023
@ydzhou
Copy link
Contributor Author

ydzhou commented Mar 16, 2023

OK, I tried to do it using the tip. But Fern behaves very weird. Can you reproduce?

My config

augroup FernOpenInAllTabs
  autocmd! *
  autocmd TabEnter * ++nested Fern . -drawer
augroup END

Step to produce:

  1. Open vim
  2. Toggle Fern drawer
  3. Open new tab :tabnew
  4. Fern shows up empty and take half of my vim window

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed maybe oneday Things maybe implemented oneday
Projects
None yet
Development

No branches or pull requests

3 participants