# Basic vars set shellopts '-eu' set ifs "\n" set scrolloff 10 set shell "/bin/sh" set icons set period 1 set dirfirst true set drawbox true set preview true set ratios 1:3:5 set tabstop 4 set previewer '~/.config/lf/scope' # cmds/functions cmd open ${{ case $(file --mime-type "$(readlink -f $f)" -b) in application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) localc $fx ;; application/vnd.openxmlformats-officedocument.wordprocessingml.document) docx2txt $f | $PAGER ;; image/vnd.djvu|application/pdf|application/octet-stream|application/postscript) setsid zathura $fx >/dev/null 2>&1 ;; text/html) $BROWSER $fx ;; text/plain) $PAGER $fx ;; text/*|application/json|inode/x-empty) bat --style=plain --tabs 4 --paging=always -f $fx ;; image/x-xcf) gimp $f >/dev/null 2>&1 ;; image/svg+xml) display -- $f ;; image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" | nsxiv -aibof 2>/dev/null | while read -r file; do [ -z "$file" ] && continue lf -remote "send select \"$file\"" lf -remote "send toggle" done ;; audio/*) mpv --no-audio-display --audio-channels=stereo $fx ;; video/*) mpv --really-quiet --audio-channels=stereo $fx >/dev/null 2>&1 ;; *opendocument*) odt2txt $f | $PAGER ;; application/pdf|application/vnd*|application/epub*) zathura $fx >/dev/null 2>&1 ;; application/pgp-encrypted) $EDITOR $fx ;; *) for f in $fx; do xdg-open $f >/dev/null 2>&1; done;; esac }} cmd mkdir $mkdir -p "$(echo $* | sed 's/ /\ /g')" cmd bulkrename $vidir $fx cmd showallpics $exa *.png *.jpg *.jpeg *.gif *.webp *.tif *.ico 2>/dev/null | nsxiv -taib & cmd newtermedit $EDITOR $fx map gr cd / map gm cd ~/hdd map gw cd ~/stoc1/work map gS cd ~/pics/scrot map gc cd ~/.config map gb cd ~/.local/bin map gs cd ~/.local/share map gp cd ~/.local/packs map gM cd /mnt map gt cd /tmp map gf cd ~/dev/c/c_dergods_realm_2 map za set hidden! map zh set info size:time map $lf -remote "send $id select '$(fzf)'" map open map D delete map W $$SHELL map S $$SHELL map $$SHELL map push :mkdir map push :mkdir map reload cmap cmd-escape map x !$f map X $$f map o $$PAGER $f map V showallpics map @ !clear; du -sh . map ( set ratios 1 map ) set ratios 1:1 map _ set ratios 1:4 map + set ratios 1:3:5 map = set ratios 1:3:5 map P set preview! map A rename # at the very end map c push A # new rename map I push A # at the very beginning map i push A # before extention map a push A # after extention map B bulkrename map bulkrename map down map up map e $$EDITOR $fx map E $st -e $EDITOR $fx & map push :$$EDITOR