Skip to content

Instantly share code, notes, and snippets.

@SirJson
Last active January 21, 2020 12:31
Show Gist options
  • Save SirJson/1cf3e2093cca00becdf1839a385bad0b to your computer and use it in GitHub Desktop.
Save SirJson/1cf3e2093cca00becdf1839a385bad0b to your computer and use it in GitHub Desktop.
FZF simple file explorer zfunc
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