Skip to content

Instantly share code, notes, and snippets.

@elhenro
Last active May 24, 2019 10:18
Show Gist options
  • Save elhenro/81353efebf95294749bea81f02f91e6b to your computer and use it in GitHub Desktop.
Save elhenro/81353efebf95294749bea81f02f91e6b to your computer and use it in GitHub Desktop.
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