# map . set hidden! set shell sh set info size set dircounts set hidden set number set relativenumber set ratios 1:1:2:3:5 # ranger legacy commands map J push 7j map K push 7k map } half-down map { half-up map a rename # execute current file (must be executable) map x $$f map X !$f cmd open $nvim $fx # use nvim for files # git support map gp ${{clear; git pull --rebase || true; echo "press ENTER"; read ENTER}} map gs ${{clear; git status; echo "press ENTER"; read ENTER}} map gl ${{clear; git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit}} # fzf support cmd fzf ${{ res="$(find . | fzf --reverse | 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 # rg/ripgrep support cmd rg ${{ res="$( \ RG_PREFIX="rg --column --line-number --no-heading --color=always \ --smart-case " FZF_DEFAULT_COMMAND="$RG_PREFIX ''" \ fzf --reverse --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 R rg set preview set previewer ~/.config/lf/preview.sh map i $~/.config/lf/preview.sh $f | less -RX