set icons set scrolloff 10 set ratios 1:4:3 set period 1 set ifs "\n" set info size set previewer ~/.local/bin/scope set mouse on # Custom commands cmd on-cd &{{ # '&' commands run silently in background (which is what we want here), # but are not connected to stdout. # To make sure our escape sequence still reaches stdout we pipe it to /dev/tty printf "\033]0; lf - $PWD\007" > /dev/tty }} on-cd cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')" cmd delete ${{ clear; tput cup $(($(tput lines)/3)); tput bold set -f printf "%s\n\t" "$fx" printf "delete?[y/N]" read ans [ $ans = "y" ] && rm -rf -- $fx }} # compress current file or selected files with tar and gunzip cmd tar ${{ set -f mkdir $1 cp -r $fx $1 tar -czf $1.tar.gz $1 rm -rf $1 }} # extract the current file with the right command cmd extract ${{ set -f case $f in *.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf $f;; *.tar.gz|*.tgz) tar xzvf $f;; *.tar.xz|*.txz) tar xJvf $f;; *.zip) unzip $f;; *.rar) unrar x $f;; *.7z) 7z x $f;; esac }} # change dir with fzf cmd fzf_jump ${{ res="$(find . -type d | fzf --header='Jump to location')" if [ -d "$res" ]; then cmd="cd" else cmd="select" fi lf -remote "send $id $cmd \"$res\"" }} # open file with fzf cmd fzf_open ${{ res="$(find . -type d -path "*/\.*" -prune -o -not -name ".*" -type f | fzf)" if [ -e "$res" ]; then cmd="mimeo" else cmd="select" fi $cmd "$res" }} # drag and drop prompt cmd dragon $dragon-drop -a $fx cmd dragon_drop $cp $(dragon-drop --target | sed 's/file:\/\///g') . # copy path to clipboard cmd yank-path &printf '%s' "$fx" | wl-copy cmd open &mimeo $fx cmd hard_link %{{ load=$(cat ~/.local/share/lf/files) list=$(echo "$load" | sed '1d') ln $list . }} # Bindings map A rename map c map cc clear map cd push :cd map cw push A # rename from zero map I push A # rename from the beginning map i push A # rename before extention map a push A # rename after extention map push :mkdir map push :$touch map reload map shell map D delete map shell map f :fzf_jump map o :fzf_open map t :dragon map T :dragon_drop map W $setsid $TERMINAL > /dev/null 2>&1 & # open new terminal window map Y :yank-path map L $LESSOPEN='| ~/.local/bin/scope %s' less -r $f # open file preview in pager map P hard_link # Mouse bindings map open map updir map invert map up map down