From 68c32da555250ba68f582314b03004f05f215e9d Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Thu, 5 Jun 2025 17:06:12 -0500 Subject: remove vimv script since it is installed by nixos now --- misc/vimv | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100755 misc/vimv (limited to 'misc/vimv') diff --git a/misc/vimv b/misc/vimv deleted file mode 100755 index b0579f1..0000000 --- a/misc/vimv +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash -set -eu - -# Lists the current directory's files in Vim, so you can edit it and save to rename them -# USAGE: vimv [file1 file2] -# https://github.com/thameera/vimv - -declare -r FILENAMES_FILE=$(mktemp "${TMPDIR:-/tmp}/vimv.XXXXXX") - -trap '{ rm -f "${FILENAMES_FILE}" ; }' EXIT - -if [ $# -ne 0 ]; then - src=( "$@" ) -else - IFS=$'\r\n' GLOBIGNORE='*' command eval 'src=($(ls))' -fi - -for ((i=0;i<${#src[@]};++i)); do - echo "${src[i]}" >> "${FILENAMES_FILE}" -done - -${EDITOR:-vi} "${FILENAMES_FILE}" - -IFS=$'\r\n' GLOBIGNORE='*' command eval 'dest=($(cat "${FILENAMES_FILE}"))' - -if (( ${#src[@]} != ${#dest[@]} )); then - echo "WARN: Number of files changed. Did you delete a line by accident? Aborting.." >&2 - exit 1 -fi - -declare -i count=0 -for ((i=0;i<${#src[@]};++i)); do - if [ "${src[i]}" != "${dest[i]}" ]; then - mkdir -p "$(dirname "${dest[i]}")" - if git ls-files --error-unmatch "${src[i]}" > /dev/null 2>&1; then - git mv "${src[i]}" "${dest[i]}" - else - mv "${src[i]}" "${dest[i]}" - fi - ((++count)) - fi -done - -echo "$count" files renamed. -- cgit v1.2.3