Last active
January 21, 2020 12:31
-
-
Save SirJson/1cf3e2093cca00becdf1839a385bad0b to your computer and use it in GitHub Desktop.
FZF simple file explorer zfunc
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
A=$PWD | |
[[ -n $1 ]] && a="$1" || a="$PWD" | |
cd $a | |
local dir=$((printf '..\n' && exa -F1a --color=always) | fzf --reverse --exact --ansi --preview="test -f {} && bat --color=always --paging=never --decorations=always --italic-text=always --style=full {} || test -d {} && exa -Fla --color=always {} || echo ''") | |
test -d "$dir" && explorer $dir | |
test -f "$dir" && $EDITOR $dir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment