You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current behavior of the c0/d0 motion in oil.nvim deletes a file entirely and creates a new one, which is unintuitive for renaming workflows.
Proposal
Make the c0/d0 motion support renaming a file instead of deleting and recreating it.
Expected Behavior
When c0 is used within the filename:
Transition into renaming mode (similar to a buffer edit) without deleting the file.
The file should only be renamed after the change is applied.
Screen.Recording.mov
Provide background
When renaming a file (e.g., foo.md), users often move the cursor to the file name, perhaps around the . delimiter, and use motions like c0 to change the file's name. Currently, this deletes the file instead of facilitating a rename. Changing this behavior to directly rename the file would:
Align with user expectations for text-editing motions in buffers.
Provide a smoother, less destructive workflow for managing files in the explorer.
What is the significance of this feature?
strongly desired
Additional details
No response
The text was updated successfully, but these errors were encountered:
This is unfortunately one of the limitations of the implementation right now. I don't particularly want to introduce some sort of hack like remapping c0/d0 because I think that's more likely to create confusion be difficult to support. The solution here is if Neovim adds support for extmarks that can be deleted and pasted. We have 2/3 of what we need with the invalidate and undo_restore parameters of nvim_buf_set_extmark, but we need some way to make it so that a deleted range with an extmark that gets pasted retains that extmark (or some data from the original). If we get that, then I can get rid of the leading ID numbers on the lines entirely and fix this edge case.
Did you check existing requests?
Describe the feature
Issue Description
The current behavior of the
c0/d0
motion in oil.nvim deletes a file entirely and creates a new one, which is unintuitive for renaming workflows.Proposal
Make the
c0/d0
motion support renaming a file instead of deleting and recreating it.Expected Behavior
When
c0
is used within the filename:Screen.Recording.mov
Provide background
When renaming a file (e.g.,
foo.md
), users often move the cursor to the file name, perhaps around the.
delimiter, and use motions likec0
to change the file's name. Currently, this deletes the file instead of facilitating a rename. Changing this behavior to directly rename the file would:What is the significance of this feature?
strongly desired
Additional details
No response
The text was updated successfully, but these errors were encountered: