lf: fix dupe keybind
This commit is contained in:
parent
53d66d0a2f
commit
d19ef643d4
2 changed files with 3 additions and 6 deletions
|
@ -104,11 +104,9 @@ cmd paste &{{
|
|||
|
||||
cmd dupe &{{
|
||||
for file in $fx; do
|
||||
find "$PWD" "$file" -maxdepth 0 | grep -oP '(?<=.\.~)\d+(?=~$)' | sort -n | tail -1 | (
|
||||
ext=$(($(cat /dev/stdin)+1))
|
||||
filedest="$(echo "$file" | sed 's/.~[[:digit:]]*~$//').~$ext~"
|
||||
cp -r "$file" "$filedest"
|
||||
)
|
||||
basename=$(basename "$file" | sed 's/\.~[0-9]*~$//')
|
||||
target=$(fd -gud1 "*$basename*" "$PWD" | sort -V | awk -F '~' 'END { sub(/(\.~[0-9]*~){0,1}$/, (".~" $(NF-1)+1 "~")); print }')
|
||||
cp -a "$file" "$target"
|
||||
done
|
||||
}}
|
||||
|
||||
|
|
|
@ -9,4 +9,3 @@ context.work.write=+work
|
|||
|
||||
include /usr/share/doc/task/rc/dark-16.theme
|
||||
include /usr/share/doc/task/rc/holidays.de-DE.rc
|
||||
context=work
|
||||
|
|
Loading…
Add table
Reference in a new issue