lf additions

This commit is contained in:
Luke Smith 2020-12-26 09:38:52 -05:00
parent f47ab40c5f
commit 51b8dda985
No known key found for this signature in database
GPG key ID: 4C50B54A911F6252

View file

@ -5,7 +5,6 @@ set shell bash
set shellopts '-eu' set shellopts '-eu'
set ifs "\n" set ifs "\n"
set scrolloff 10 set scrolloff 10
set color256
set icons set icons
set period 1 set period 1
set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml" set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml"
@ -18,8 +17,9 @@ 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) setsid -f zathura $fx >/dev/null 2>&1 ;;
text/*) $EDITOR $fx;; text/*) $EDITOR $fx;;
image/x-xcf|image/svg+xml) setsid -f gimp $f >/dev/null 2>&1 ;; image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;;
image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\)\(_large\)*$" | sxiv -aio 2>/dev/null | lf-select ;; image/svg+xml) display -- $f ;;
image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" | sxiv -aio 2>/dev/null | lf-select ;;
audio/*) mpv --audio-display=no $f ;; audio/*) mpv --audio-display=no $f ;;
video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;; video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;;
application/pdf|application/vnd*|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;; application/pdf|application/vnd*|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;;
@ -35,14 +35,14 @@ cmd delete ${{
printf "%s\n\t" "$fx" printf "%s\n\t" "$fx"
printf "delete?[y/N]" printf "delete?[y/N]"
read ans read ans
[ $ans = "y" ] && rm -rf $fx [ $ans = "y" ] && rm -rf -- $fx
}} }}
cmd moveto ${{ 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="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf | sed 's|~|$HOME|' )" && dest="$(cut -d' ' -f2- ${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 &&
@ -53,7 +53,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="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf | sed 's|~|$HOME|' )" && dest="$(cut -d' ' -f2- ${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 &&
@ -65,7 +65,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 $(cut -d' ' -f2 ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf)" map J $lf -remote "send $id cd $(cut -d' ' -f2 ${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