From 1f2f8b9dab1058814f0e5d37d3d836b5b1be10ee Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Wed, 26 Mar 2025 18:45:07 -0400 Subject: [PATCH] AutoYADM commit: 2025-03-26 18:45:07 --- .config/pet/snippet.toml | 5 ----- .zsh/functions/ren | 5 ++++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.config/pet/snippet.toml b/.config/pet/snippet.toml index eb5ec89f..c6fb28db 100644 --- a/.config/pet/snippet.toml +++ b/.config/pet/snippet.toml @@ -17,8 +17,3 @@ Tag = ["python", "scratch"] command = "rm -f /tmp/tmp.*.py" -[[Snippets]] - Description = "Rename" - Output = "" - Tag = [] - command = "mv \"${$(realpath )%%$(basename )}\"" diff --git a/.zsh/functions/ren b/.zsh/functions/ren index b13f5906..7471318a 100644 --- a/.zsh/functions/ren +++ b/.zsh/functions/ren @@ -1,8 +1,11 @@ #!/bin/env zsh +# utility to easily rename a file without +# having to type out its path twice function ren { from="$1" to="$2" DIR="${$(realpath "$from")%%$(basename "$from")}" # echo "$DIR" - echo "$(realpath "$from")" "$DIR$to" + mv "$(realpath "$from")" "$DIR$to" + echo "Moved $(realpath "$from") to $DIR$to" }