dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit cf4271d766c2f15dea8ca49cc4a9b708bc6d6bc6
parent 87bb45aa6edf0dc1cc5abd46f2c0ace70c11cb2d
Author: Alex Balgavy <alex@balgavy.eu>
Date:   Wed, 22 Dec 2021 00:03:32 +0100

lf: paste-rename function

Diffstat:
Mlf/lfrc | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/lf/lfrc b/lf/lfrc @@ -186,6 +186,23 @@ cmd paste_link %{{ ln -sr $files -t . }} +cmd paste_rename %{{ + mode="$(head -n 1 ~/.local/share/lf/files)" + for fname in $(tail -n +2 ~/.local/share/lf/files); do + while [ -z "${newfname:-}" ]; do + printf "%s => " "$fname" + read -r newfname + done + if [ "$mode" = 'copy' ]; then + cp -n "$fname" ./"$newfname" + else + mv -n "$fname" ./"$newfname" + fi + done + lf -remote 'send clear' + lf -remote 'send load' +}} + # preview the highlighted file with quicklook (macOS) cmd ql_preview &{{ qlmanage -p $fx &> /dev/null; @@ -368,6 +385,7 @@ map Y copy_path map p map pp paste map pl paste_link +map pr paste_rename # Viewing map i file_info