From de93c6782636f5047873c752a3385638633802a8 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Wed, 26 Mar 2025 18:30:07 -0400 Subject: [PATCH] AutoYADM commit: 2025-03-26 18:30:07 --- .config/pet/snippet.toml | 5 +++++ .zsh/functions/ren | 8 ++++++++ .zshrc | 1 + 3 files changed, 14 insertions(+) create mode 100644 .zsh/functions/ren diff --git a/.config/pet/snippet.toml b/.config/pet/snippet.toml index c6fb28db..eb5ec89f 100644 --- a/.config/pet/snippet.toml +++ b/.config/pet/snippet.toml @@ -17,3 +17,8 @@ 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 new file mode 100644 index 00000000..b13f5906 --- /dev/null +++ b/.zsh/functions/ren @@ -0,0 +1,8 @@ +#!/bin/env zsh +function ren { + from="$1" + to="$2" + DIR="${$(realpath "$from")%%$(basename "$from")}" + # echo "$DIR" + echo "$(realpath "$from")" "$DIR$to" +} diff --git a/.zshrc b/.zshrc index 8e857ab9..0e11df86 100644 --- a/.zshrc +++ b/.zshrc @@ -126,6 +126,7 @@ export PATH="$PATH:/home/fic/.luarocks/bin" export PATH="$PATH:/home/fic/.local/share/npm/bin" fpath=(~/.zsh/functions $fpath) autoload -Uz syncthing_menu +autoload -Uz ren # fpath=(~/.zsh.d/ $fpath) function noh() { nohup "$@" >/dev/null 2>&1 &