diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 4d9857e..741f1a9 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -6,6 +6,8 @@ set previewer ~/.config/lf/scope set shellopts '-eu' set ifs "\n" set scrolloff 10 +set color256 +set icons # Enable icons. Requires nerd fonts and LF_ICONS variable. # cmds/functions cmd open ${{ @@ -13,7 +15,7 @@ cmd open ${{ text/troff) man ./ $f;; text/*) $EDITOR $fx;; image/x-xcf|image/svg+xml) setsid gimp $f >/dev/null 2>&1 & ;; - image/*) rotdir $f | setsid sxiv -ai >/dev/null 2>&1 & ;; + image/*) rotdir $f | setsid sxiv -aio 2>&1 | lf-select & ;; audio/*) mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) $f ;; video/*) setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) $f -quiet >/dev/null 2>&1 & ;; application/pdf) setsid zathura $fx >/dev/null 2>&1 & ;; @@ -26,7 +28,7 @@ cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1 cmd delete ${{ set -f printf "%s\n\t" "$fx" - printf "delete?[y/n]" + printf "delete?[y/N]" read ans [ $ans = "y" ] && rm -rf $fx }} @@ -49,6 +51,7 @@ cmd copyto ${{ # Bindings map c $lf -remote "send $id cd $(cut -d' ' -f2 ~/.config/directories | fzf)" +map $lf -remote "send $id select '$(fzf)'" map J $lf -remote "send $id cd $(cut -d' ' -f2 ~/.config/directories | fzf)" map gh map g top @@ -57,8 +60,9 @@ map C copyto map M moveto map a push %mkdir map r push :rename +map R $lf -remote "send $id push :rename$f" +map reload map shell -map R reload map x $$f map X !$f map o &mimeopen $f diff --git a/.zprofile b/.zprofile index 5be31c8..5577e5c 100644 --- a/.zprofile +++ b/.zprofile @@ -43,3 +43,5 @@ export LESS_TERMCAP_ue="$(printf '%b' '')" # Switch escape and caps if tty: sudo -n loadkeys ~/.local/share/larbs/ttymaps.kmap 2>/dev/null + +export LF_ICONS="di=:fi=:ln=:or=:ex=:*.c=:*.cc=:*.clj=:*.coffee=:*.cpp=:*.css=:*.d=:*.dart=:*.erl=:*.exs=:*.fs=:*.go=:*.h=:*.hh=:*.hpp=:*.hs=:*.html=:*.java=:*.jl=:*.js=:*.json=:*.lua=:*.md=:*.php=:*.pl=:*.pro=:*.py=:*.rb=:*.rs=:*.scala=:*.ts=:*.vim=:*.cmd=:*.ps1=:*.sh=:*.bash=:*.zsh=:*.fish=:*.tar=:*.tgz=:*.arc=:*.arj=:*.taz=:*.lha=:*.lz4=:*.lzh=:*.lzma=:*.tlz=:*.txz=:*.tzo=:*.t7z=:*.zip=:*.z=:*.dz=:*.gz=:*.lrz=:*.lz=:*.lzo=:*.xz=:*.zst=:*.tzst=:*.bz2=:*.bz=:*.tbz=:*.tbz2=:*.tz=:*.deb=:*.rpm=:*.jar=:*.war=:*.ear=:*.sar=:*.rar=:*.alz=:*.ace=:*.zoo=:*.cpio=:*.7z=:*.rz=:*.cab=:*.wim=:*.swm=:*.dwm=:*.esd=:*.jpg=:*.jpeg=:*.mjpg=:*.mjpeg=:*.gif=:*.bmp=:*.pbm=:*.pgm=:*.ppm=:*.tga=:*.xbm=:*.xpm=:*.tif=:*.tiff=:*.png=:*.svg=:*.svgz=:*.mng=:*.pcx=:*.mov=:*.mpg=:*.mpeg=:*.m2v=:*.mkv=:*.webm=:*.ogm=:*.mp4=:*.m4v=:*.mp4v=:*.vob=:*.qt=:*.nuv=:*.wmv=:*.asf=:*.rm=:*.rmvb=:*.flc=:*.avi=:*.fli=:*.flv=:*.gl=:*.dl=:*.xcf=:*.xwd=:*.yuv=:*.cgm=:*.emf=:*.ogv=:*.ogx=:*.aac=:*.au=:*.flac=:*.m4a=:*.mid=:*.midi=:*.mka=:*.mp3=:*.mpc=:*.ogg=:*.ra=:*.wav=:*.oga=:*.opus=:*.spx=:*.xspf=:*.pdf="