Skip to content
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

helix-view:move_path create target directory on move #11593

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pontuslaestadius
Copy link

First contribution correct me on anything or everything.

Resolves #11536

Test commands:

:open new_file.txt
:move kung/foo/panda.txt

Note: I do think that the move_path command should also be able to handle being passed a directory name, that currently results in Could not move file: Is a directory (os error 21)
It felt like a behavioral change so I didn't include it here. I could amend this pull request with that fix as well.

@the-mikedavis
Copy link
Member

the-mikedavis commented Sep 1, 2024

I think this should be combined with a change like #11093 that introduces :move!/:mv!, and only those ! commands would create parent directories like mkdir -p. :write/:w is the same: it refuses to create parent directories but :write!/:w! creates them.

I agree it would be handy to be able to specify a directory and move the file under that directory like the mv Unix command. That can be done as a follow-up PR

@the-mikedavis the-mikedavis added the A-command Area: Commands label Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-command Area: Commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create directory if not exist when move buffer
2 participants