diff options
author | zachir <zachir@librem.one> | 2025-07-15 20:58:23 -0500 |
---|---|---|
committer | zachir <zachir@librem.one> | 2025-07-15 20:58:23 -0500 |
commit | 6a085b3865a575fa669ebd1a957e268e29ff57a2 (patch) | |
tree | 9b965d4493074e7e08211704a94c5512e172bc2f | |
parent | 2cb2c1039650dd919b57022bc5d24c1ad3a842ea (diff) |
Use vimv as an AUR package, not here
-rw-r--r-- | LICENSE-vimv | 18 | ||||
-rwxr-xr-x | vimv | 46 |
2 files changed, 0 insertions, 64 deletions
diff --git a/LICENSE-vimv b/LICENSE-vimv deleted file mode 100644 index 169b39d..0000000 --- a/LICENSE-vimv +++ /dev/null @@ -1,18 +0,0 @@ -Copyright 2017 Thameera Senanayaka - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# Copyright Thameera Senanayaka on GitHub, MIT (see LICENSE-vimv) -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. - |