A way to preserve Fern state when reopening/toggling #321
Replies: 2 comments 3 replies
-
Welcome! Well, I've recently allowed discussion thus it's quite yet.
Yes and no. For drawer, yes. Just re-open it by Kapture.2021-04-03.at.22.30.45.mp4For split, no. Every split buffer will gain different name after opened in design so it's not possible to restore by Kapture.2021-04-03.at.22.31.27.mp4 |
Beta Was this translation helpful? Give feedback.
-
Hi. Thanks for the prompt reply! I tried drawer toggle before asking however it seems to only work if you never leave the pwd. The moment you move up the hierarchy you end up in pwd after showing drawer again. Which most certainly has to do with the fact that you can't invoke Fern without giving it the root path URL. I mean, a special case for toggle would be super handy unless this is already doable through some other means, of course. Something like: The usual way: Keeping current root: Also I'm not quite sure why do you still need to give it the URL when toggling off (hiding)? Thanks |
Beta Was this translation helpful? Give feedback.
-
Hi
It is kinda quiet here in fern.vim discussions section. Not sure this is the right place to ask questions but I'll try anyway.
Is there a way to somehow preserve current Fern browser buffer state when reopening Fern in split window mode or toggling drawer. So that the next time I open/toggle Fern again it is in the same state where I left it last time, including root dir, expanded/collapsed items and cursor position.
Let me explain where I come from. I only just discovered fern.vim and after couple days of toying around I find it to be a super useful plugin. There are just few missing features to make it even better IMHO. For instance, I seems can't figure how to preserve Fern window state after closing then opening it again.
Say I open a full window Fern via Fern . command. Spend a great deal of time to find the locations and files I need in a huge project. Expand the relevant portions of the tree view, select some initial files then hit open to start editing. Later I need to switch to other files in the same locations. So what are my options? If I do Fern . again I'll be back at square one and have to spend again considerable amount of time to navigate and locate the files. I tried keeping some notes on the paths then use Fern /full/path every time but it takes even longer than simply opening Fern at pwd then navigating to needed locations manually.
I've been looking through the docs and seems can't find any solution to this problem. The only workaround I can find is to keep drawer all the time open however this too doesn't quite work for me for several reason. First drawer is useless on huge projects with high depth structure. The drawer width is just not enough to have my current working branches open, it doesn't fit unless you make the drawer window real big eating into editing window space at which point I'd rather use a split mode Fern instead.
I suppose I could somehow use a separate "Fern" tab and perhaps make it open files in the first "Editing" tab and remain open but this sounds like an overkill even if possible.
Any ideas please? Did I miss something obvious?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions