Skip to content

Allow creating directories when renaming files (behavior like create file) #2630

@SimonEggert

Description

@SimonEggert

Is your feature request related to a problem? Please describe.
I recently discovered that it is currently not possible to rename a file and move it to another folder via nvim-tree's rename operation. I had hoped it worked the way creating files works where you can use foo/bar to create a new folder foo with a bar file inside it. Rename just creates a file called foo/bar instead.

Describe the solution you'd like
When renaming a file ./bar I want to be able to edit the "file name" to ./foo/bar and have the file be nested in the created folder.

Describe alternatives you've considered
A colleague mentioned that VSCode had this feature when renaming files.

Additional context
The issue is not a big deal but I expected the two operations "rename" and "create" to be similar in behavior. Could this be done in a similar way in the code? I think the folder creation happens in this loop.

Thanks for considering and keep up the great work! 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR pleasenvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciatedQOLQuality Of Life Improvementfeature request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions