-
-
Save franklincm/73be4fc4480af60df64be04bd35e131f to your computer and use it in GitHub Desktop.
lf + fzf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmd fzfdirs ${{ | |
FZF_DEFAULT_OPTS="--preview 'bat --style=numbers --color=always {}' --height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_CTRL_T_OPTS-}" | |
D=`find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune -o -type d -print -o -type l -print 2> /dev/null | cut -b3- | fzf -m` | |
if [[ $D == '' ]]; then | |
lf -remote "send $id echo fzf aborted." | |
else | |
lf -remote "send $id cd $D" | |
fi | |
}} | |
map <c-t> fzfdirs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment