-
Notifications
You must be signed in to change notification settings - Fork 143
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 request: prefer creation of files over directories with :e in oil buffer #77
Comments
Hey, good to see you back in the vimscape! I have two ideas for this. The first is pretty minimal: you could use a vim.cmd.cabbr({ args = { "<expr>", "%", "&filetype == 'oil' ? bufname('%')[6:] : '%'" } }) It's not a drop-in replacement for your workflow, but you would at least be able to keep some of the same muscle memory. The second idea is drafted in this PR: #78 |
Just visiting :) I can definitely work around it. I just wanted to bring it to your attention :) I think #78 is an elegant solution, but totally your call if you don't want to add the complexity! |
Happy to merge #78! I'll just have to wrangle the CI tests into passing :/ |
Did you check existing requests?
Describe the feature
I regularly use netrw with vinegar style bindings (- to go up). My default workflow for creating a new file in a given project is to open netrw, navigate to the directory I want, and
:e %:p:h
-> tab -> new filename.Unfortunately, by default oil will open with a url of the form:
:e oil:///Users/michael/Repositories/fluffychat/macos
This means that if I append
test.file
I get:e oil:///Users/michael/Repositories/fluffychat/macos/test.file
Which opens me in a new oil buffer, rather than a text buffer (accidentally wrote 20 new files instead of a 20 line file this way).
I'm not sure how to handle this (or I would have filed a PR), since there is not a good way to disambiguate between new file/folder by path alone, but I guess my expectation as a user with
:e
would be that the final path element would correspond to a new file.Provide background
No response
Additional details
Love the plugin! If I was still a neovim dev I would tell you to upstream it and tear out netrw :)
The text was updated successfully, but these errors were encountered: