-
-
Save elhenro/81353efebf95294749bea81f02f91e6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set previewer ~/.config/lf/pv.sh | |
cmd trash ${{ | |
mkdir -p ~/trash | |
if [ -z "$fs" ]; then | |
mv "$f" ~/trash | |
else | |
IFS="`printf '\n\t'`"; mv $fs ~/trash | |
fi | |
}} | |
cmd archive ${{ | |
mkdir -p ~/archive | |
if [ -z "$fs" ]; then | |
mv "$f" ~/archive | |
else | |
IFS="`printf '\n\t'`"; mv $fs ~/archive | |
fi | |
}} | |
cmd open ${{ | |
case "$f" in | |
*.tar.bz|*.tar.bz2|*.tbz|*.tbz2|*.tar.gz|*.tgz|*.tar.xz|*.txz|*.zip|*.rar|*.iso) | |
mntdir="$f-archivemount" | |
[ ! -d "$mntdir" ] && { | |
mkdir "$mntdir" | |
archivemount "$f" "$mntdir" | |
echo "$mntdir" >> "/tmp/__lf_archivemount_$id" | |
} | |
lf -remote "send $id cd \"$mntdir\"" | |
lf -remote "send $id reload" | |
;; | |
*) | |
for f in $fx; do | |
$OPENER $f > /dev/null 2> /dev/null & | |
done;; | |
esac | |
}} | |
map D trash | |
map A archive | |
cmd fzf $vi $(find . -name "$1" | fzf) | |
#map f push :fzf<space> | |
map f $lf -remote "send $id select '$(fzf)'" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment