lf tweaks

This commit is contained in:
Luke Smith 2021-11-12 17:02:41 -05:00
parent 18de46de1a
commit ee0203f2ac
No known key found for this signature in database
GPG key ID: 4C50B54A911F6252

View file

@ -15,7 +15,7 @@ $lf -remote "send $id set previewer ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope"
# cmds/functions # cmds/functions
cmd open ${{ cmd open ${{
case $(file --mime-type $f -b) in case $(file --mime-type $f -b) in
image/vnd.djvu|application/pdf|application/octet-stream) setsid -f zathura $fx >/dev/null 2>&1 ;; image/vnd.djvu|application/pdf|application/octet-stream|application/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;;
text/*) $EDITOR $fx;; text/*) $EDITOR $fx;;
image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;;
image/svg+xml) display -- $f ;; image/svg+xml) display -- $f ;;
@ -52,7 +52,7 @@ cmd moveto ${{
clear; tput cup $(($(tput lines)/3)); tput bold clear; tput cup $(($(tput lines)/3)); tput bold
set -f set -f
clear; echo "Move to where?" clear; echo "Move to where?"
dest="$(sed -e 's/#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" && dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" &&
for x in $fx; do for x in $fx; do
eval mv -iv \"$x\" \"$dest\" eval mv -iv \"$x\" \"$dest\"
done && done &&
@ -63,7 +63,7 @@ cmd copyto ${{
clear; tput cup $(($(tput lines)/3)); tput bold clear; tput cup $(($(tput lines)/3)); tput bold
set -f set -f
clear; echo "Copy to where?" clear; echo "Copy to where?"
dest="$(sed -e 's/#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" && dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" &&
for x in $fx; do for x in $fx; do
eval cp -ivr \"$x\" \"$dest\" eval cp -ivr \"$x\" \"$dest\"
done && done &&
@ -75,7 +75,7 @@ cmd bulkrename $vidir
# Bindings # Bindings
map <c-f> $lf -remote "send $id select '$(fzf)'" map <c-f> $lf -remote "send $id select '$(fzf)'"
map J $lf -remote "send $id cd $(sed -e 's/#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)" map J $lf -remote "send $id cd $(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)"
map gh map gh
map g top map g top
map D delete map D delete