Skip to content

feat: Show parent directory in a split next to oil buffer#488

Open
DriesOlbrechts wants to merge 1 commit intostevearc:masterfrom
DriesOlbrechts:master
Open

feat: Show parent directory in a split next to oil buffer#488
DriesOlbrechts wants to merge 1 commit intostevearc:masterfrom
DriesOlbrechts:master

Conversation

@DriesOlbrechts
Copy link

This PR adds the feature requested in #349.

A split is opened showing the parent directory for the current oil directory.
This PR is an improvement on #487.
After looking at the code again I realised I was completely overcomplicating my solution and rewrote it.

I love what you're doing with Oil.nvim and hope my contribution can add some value!

@DriesOlbrechts
Copy link
Author

@stevearc any reason this isn't being looked at?
I'm happy to receive any feedback!

Copy link
Owner

@stevearc stevearc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the long wait; I haven't written a full accounting of this anywhere yet. The way I like to manage my projects is by maintaining "inbox zero," so zero open unanswered issues/PRs. Some time last year my backlog got so long that it was causing me a lot of stress and killing my motivation to do any work at all, making the problem worse. I decided to declare "bug bankruptcy" and manually zero out my inbox, only responding to new issues & PRs after that cutoff. The good news is that it worked and I've been able to continue maintaining my projects, but the bad news is that it obviously left a lot of threads dangling, which is unfair to people like you that put in a lot of work crafting a PR or writing up a good bug report. So for you and for everyone else affected, I'm sorry, it's not a directed choice to ignore you, it's just load shedding to maintain my sanity. Due to some recent travel, sickness, more sickness, and more travel, my backlog has been creeping back up, but I'm optimistic that I'll be able to zero it out again over the next month or so. And once I've started engaging with a PR I try to give it higher priority, so hopefully this one won't get dropped again.

Now, on to the review:

I've only done a cursory review of the code, but it appears fine. The main area I'd like to focus on is the API & interface. The first incarnation of oil just had a simple directory buffer, which is easy to reason about. You go to whatever window you want, open oil, mess around, then when you open a file it opens in that same window. Then, preview windows were added as an extra option. Now you can open oil in the current window, but also make a split to show the preview window. It's a little harder to reason about / mucks up the UI a bit more, but in a limited capacity and it's aided a little bit by leaning on vim's concept of a preview window. This PR introduces the possibility for two window splits off of the original, which can get messy and hard to reason about. Three windows is also enough to basically take over all visual space on a given tab.

What do you think about instead constraining this functionality specifically to a floating window view? Right now we have :Oil --float, what if we made another specific view like :Oil --miller that opens a miller column view in floating windows, like what mini.files does? The existing floating window view could be reworked to be a subset of this functionality. Would that serve for your use case?

@DriesOlbrechts
Copy link
Author

No worries about the wait!
Happy to hear you've found a way to make it work for you!

Let's see if I'm understanding this correctly, the miller option would basically be the current floating view, but instead of the directory buffer, that would become a miller column?

That does sound like a good solution that will help my usecase as well as provide an option for people who are looking for a miller approach.

I'm happy to start working on this.
I'm not very experienced with the neovim api so if you've got any feedback / suggestions on how best to approach this always welcome 😄

@stevearc
Copy link
Owner

stevearc commented May 15, 2025

Hmmm...on second look --miller is pretty opaque if the user isn't familiar with the name "miller columns". Maybe it would be better if it were another add-on option to the float, so

  • :Oil --float for single floating win
  • :Oil --float --preview for float with preview to the right
  • :Oil --float --preview --parent-view for the full miller column layout

But we can bikeshed on this later. You asked about suggestions on how to approach this, I'd recommend looking at the existing implementation of open_float, including how it handles the preview window. You can also look at this implementation of miller columns that I made for aerial.nvim. It won't be a straight port, but some of the structure and most of the nvim API methods should translate.

@DriesOlbrechts
Copy link
Author

@stevearc
Since it's been 2 weeks and I don't seem to be able to find time to work on this, I suggest maybe tagging this as 'help wanted' or something similar!
If it's still open when I do find time in the future I will pick it up, but I don't want to block anyone else from trying.

I also accidentally closed the PR when reverting the changes, is it possible to reopen this?
Or maybe move it to a new issue that is more fit for the discussed changes.

@stevearc
Copy link
Owner

stevearc commented Jun 1, 2025

I can't reopen the PR because the branch has no changes from master. If you make some placeholder changes I can reopen it

@DriesOlbrechts DriesOlbrechts reopened this Jun 3, 2025
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

Successfully merging this pull request may close these issues.

2 participants