functions.zsh: set exa+bat preview for fzf-open
This commit is contained in:
parent
f95e448736
commit
d4eb047518
@ -48,9 +48,14 @@ delete-branches() {
|
|||||||
|
|
||||||
fzf-open() {
|
fzf-open() {
|
||||||
local output
|
local output
|
||||||
|
local old_opts="$FZF_DEFAULT_OPTS"
|
||||||
|
FZF_DEFAULT_OPTS+=" --preview 'exa -al --group --group-directories-first --colour-scale --list-dirs --icons --git --time-style=full-iso {}' --bind '?:preview:bat --style=numbers --color=always --line-range :200 {}'"
|
||||||
output=$(fzf </dev/tty)
|
output=$(fzf </dev/tty)
|
||||||
vim --not-a-term ${output}
|
if [ ! -z "$output" ]; then
|
||||||
|
vim --not-a-term ${output}
|
||||||
|
fi
|
||||||
zle reset-prompt
|
zle reset-prompt
|
||||||
|
export FZF_DEFAULT_OPTS="$old_opts"
|
||||||
}
|
}
|
||||||
|
|
||||||
zle -N fzf-open
|
zle -N fzf-open
|
||||||
|
Loading…
Reference in New Issue
Block a user