From 4684d80b6271dd775cd23dabf2b91d6ce56fa33a Mon Sep 17 00:00:00 2001 From: Ensa Date: Fri, 20 Dec 2019 00:14:09 -0800 Subject: first significant commit see README.md for information --- config/lf/lfrc | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 config/lf/lfrc (limited to 'config/lf/lfrc') diff --git a/config/lf/lfrc b/config/lf/lfrc new file mode 100644 index 0000000..21634d4 --- /dev/null +++ b/config/lf/lfrc @@ -0,0 +1,37 @@ +# sets +set shell sh +set shellopts '-eu' +set ifs "\n" + +# cmds +cmd open ${{ + case $(file -bi $f) in + text/troff) man ./ $f;; + text/*) $EDITOR $fx;; + image/x-xcf|image/svg+xml) gimp $f >/dev/null 2>&1 & ;; + image/vnd.djvu|application/epub+zip|application/pdf) zathura $f >/dev/null 2>&1 & ;; + image/*) sxiv -ai >/dev/null 2>&1 & ;; + audio/*) mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) --quiet $f >/dev/null 2>&1 & ;; + video/*) mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) $f ;; + *) for f in $fx; do lh $f > /dev/null 2>&1 & done;; + esac +}} + +cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1 + +cmd delete ${{ + set -f + printf "%s\n\t" "$fx" + printf "delete?[y/n]" + read ans + [ $ans = "y" ] && rm -rf $fx +}} + +# binds +map D delete +map a push %mkdir +map r push :rename +map shell +map R reload +map x $$f +map X !$f -- cgit 1.4.1-2-gfad0