set previewer ~/.config/lf/pv.sh map i $~/.config/lf/pv.sh $f | less -R # Trash cmd trash %trash-put "$fx" # Search with fzf # map f $vi $(fzf) # If you want to jump to a file or directory in lf using fuzzy matching, you can utilize fzf for this purpose: cmd fzf_jump ${{ res="$(fd . | fzf --reverse --header='Jump to location' | sed 's/\\/\\\\/g;s/"/\\"/g')" if [ -d "$res" ] ; then cmd="cd" elif [ -f "$res" ] ; then cmd="select" else exit 0 fi lf -remote "send $id $cmd \"$res\"" }} map f :fzf_jump # Combining fzf with ripgrep, you can interactively search in the contents of files under the current directory and select a file from the results: cmd fzf_search ${{ res="$( \ RG_PREFIX="rg --column --line-number --no-heading --color=always \ --smart-case " FZF_DEFAULT_COMMAND="$RG_PREFIX ''" \ fzf --bind "change:reload:$RG_PREFIX {q} || true" \ --ansi --layout=reverse --header 'Search in files' \ | cut -d':' -f1 )" [ ! -z "$res" ] && lf -remote "send $id select \"$res\"" }} map gs :fzf_search # Recreate open-with with lf cmd open-with %"$@" "$fx" map ` push :open-with # Show current directory in window title 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; $PWD\007" > /dev/tty }} map r reload # Drag and drop map %dragon --all --and-exit "$fx" map &wl-copy < "$fx"