zsh: add interactive mv

This commit is contained in:
Mathieu Maret 2020-08-16 00:11:44 +02:00
parent f2bcdc906c
commit 01fe1ff04a

View File

@ -270,3 +270,14 @@ _flash_all () {
}
complete -o default -F _flash_all flash_all
# Interactive mv
imv() {
local src dst
for src; do
[[ -e $src ]] || { print -u2 "$src does not exist"; continue }
dst=$src
vared dst
[[ $src != $dst ]] && mkdir -p $dst:h && mv -n $src $dst
done
}