Created
July 11, 2025 02:48
-
-
Save IsaacGemal/fe3055d0ecfd4e9bbc57b267fb896776 to your computer and use it in GitHub Desktop.
fuzzymove
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Fuzzymove | |
| fmv() { | |
| local file=$(fd -t f | fzf --preview 'bat --style=numbers --color=always {}' --prompt="๐ File to move: ") | |
| local dest=$(printf ".\n%s" "$(fd -t d)" | fzf --preview 'eza -l --icons --color=always {}' --prompt="๐ Move to: ") | |
| if [[ -n "$file" && -n "$dest" ]]; then | |
| local filename=$(basename "$file") | |
| if [[ -e "$dest/$filename" ]]; then | |
| echo "โ ๏ธ File already exists in $dest. Move aborted." | |
| return 1 | |
| fi | |
| mv "$file" "$dest" | |
| echo "โ Moved $file to $dest" | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Adjust as needed.
Bat, fzf, and eza are needed for this to work.