# Basic Settings set previewer ~/.config/lf/pv #preview set preview true # set drawbox true # set icons true set ignorecase true set scrolloff 1 set shell zsh # unmap keys map y map d map m # keymappings # rename map C rename # at the end map c push C map push C # new rename # map B bulkrename # cut/copy/paste map yy copy map dd cut map D delete # new files/directories map md mkdir map mf mkfile # misc map H set hidden! map reload # custom commands cmd open ${{ case $(file --mime-type "$f" -bL) in text/*|application/json) $EDITOR "$f";; *) xdg-open "$f" ;; esac }} cmd mkdir ${{ printf "Directory Name: " read ans mkdir $ans }} cmd mkfile ${{ printf "File Name: " read ans $EDITOR $ans }} cmd sudomkfile ${{ printf "File Name: " read ans sudo $EDITOR $ans }} cmd chmod ${{ printf "Mode Bits: " read ans for file in "$fx" do chmod $ans $file done lf -remote 'send reload' }} # archive bindings cmd unarchive ${{ case "$f" in *.zip) unzip "$f" ;; *.tar.gz) tar -xzvf "$f" ;; *.tar.bz2) tar -xjvf "$f" ;; *.tar) tar -xvf "$f" ;; *) echo "Unsupported format" ;; esac }} cmd zip %zip -r "$f" "$f" cmd tar %tar cvf "$f.tar" "$f" cmd targz %tar cvzf "$f.tar.gz" "$f" cmd tarbz2 %tar cjvf "$f.tar.bz2" "$f" # archive mappings map az zip map at tar map ag targz map ab targz map au unarchive