# Use fd and fzf to get the args to a command. # Works only with zsh # Examples: # f mv # To move files. You can write the destination after selecting the files. # f 'echo Selected:' # f 'echo Selected music:' --extension mp3 # fm rm # To rm files in current directory f() { sels=( "${(@f)$(fd "${fd_default[@]}" "${@:2}"| fzf)}" ) test -n "$sels" && print -z -- "$1 ${sels[@]:q:q}" } # Like f, but n