helix icon indicating copy to clipboard operation
helix copied to clipboard

helix-view:move_path create target directory on move

Open pontuslaestadius opened this issue 1 year ago • 1 comments

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.

pontuslaestadius avatar Aug 28 '24 16:08 pontuslaestadius

I think this should be combined with a change like https://github.com/helix-editor/helix/pull/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 avatar Sep 01 '24 14:09 the-mikedavis