if this could help:
create a script with the name rename_with_increment_prefix.sh:
#!/bin/bash
# will rename
# 123.jpg, "live is life.txt", some_script.sh
# to
# 1_123.jpg, 2_live is life.txt, 3_some_script.sh, etc....
i=1
for f in "$@"; do
# Extract the directory, filename, and extension
dir_name=$(dirname "$f")
base_name=$(basename "$f")
# Construct the new file name with number prefix and original name
new_name="$dir_name/${i}_${base_name}"
echo "Renaming: $f to $new_name"
# Check if the new file name already exists
if [ -e "$new_name" ]; then
echo "Error: $new_name already exists."
exit 1
fi
# Rename the file
mv "$f" "$new_name"
# Increment the counter
i=$((i+1))
done
then write this line in vifmrc:
command! renameWithIncrementPrefix $VIFM_TERMINAL '/path/of/your/script/rename_with_increment_prefix.sh %f %i'
restart vifm
select a few dir or files
call the command:
:renameWithIncrementPrefix
Note: after renaming it is not possible to undo