vim-fern
vim-fern copied to clipboard
[Feature] Add the ability to retain the open/closed status of the fern drawer between tabpages
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.
Why the feature is needed? This feature is so useful? I think mimic the behavior of IDE is not the reason.
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.
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:
- Open vim
- Toggle Fern drawer
- Open new tab :tabnew
- Fern shows up empty and take half of my vim window