lambdalisue / vim-fern

🌿 General purpose asynchronous tree viewer written in Pure Vim script
MIT License
1.29k stars 49 forks source link

Add an option to call cd/lcd/tcd on the anchor buffer instead on the drawer style #115

Closed Shatur closed 4 years ago

Shatur commented 4 years ago

In #107 I run into an issue with changing directory for buffers that have set directory with :lcd. I can't change directory for such bufffers with :cd:root / :tcd:root. Suggestion: what if change current directory for the buffer from which I opened drawer on cd:root / tcd:root? I think this can be expected behavior for drawers. Or alternative suggestion: what if automatically change directory for drawer and buffer from which I opened drawer on leave and enter actions and on opening? This how it works in NERDTree. It would be nice to have such out of the box experience.

lambdalisue commented 4 years ago

In #107 I run into an issue with changing directory for buffers that have set directory with :lcd. I can't change directory for such bufffers with :cd:root / :tcd:root.

First of all, the issue that you've faced was caused by lcd. As long as I know, most of users do not need to use lcd so I strongly recommend you not use lcd at all (if a plugin invoke lcd, open a new issue on that plugin). I believe that solves your problem most sufficiently and directly.

Suggestion: what if change current directory for the buffer from which I opened drawer on cd:root / tcd:root? I think this can be expected behavior for drawers.

Sounds reasonable. I would add an option to change the current behavior as your suggestion.

Or alternative suggestion: what if automatically change directory for drawer and buffer from which I opened drawer on leave and enter actions and on opening? This how it works in NERDTree. It would be nice to have such out of the box experience.

No. I actually like that behavior but I think it should not be the default behavior while it's easy enough to say "Visit wiki and see tips".

Shatur commented 4 years ago

First of all, the issue that you've faced was caused by lcd

Of course, this is definitely not a fern.vim problem. I already opened an issue in Startify for it. I wrote it for the introduction to the proposal :)

lambdalisue commented 4 years ago

@Shatur95 Please try https://github.com/lambdalisue/fern.vim/pull/198. It opens a window selector just before executing actual lcd command in lcd action.

Shatur commented 4 years ago

Just what I need, thanks!