Closed PtrckM closed 5 months ago
Reference: https://github.com/sharkdp/bat/issues/1940
Hello! I've just fixed this (d48a879e2e32) with this slight change so that we check first if it's a directory or not. If it is, we use eza, if it isn't we use bat.
show_file_or_dir_preview="if [ -d {} ]; then eza --tree --color=always {} | head -200; else bat -n --color=always --line-range :500 {}; fi"
export FZF_CTRL_T_OPTS="--preview '$show_file_or_dir_preview'"
export FZF_ALT_C_OPTS="--preview 'eza --tree --color=always {} | head -200'"
# Advanced customization of fzf options via _fzf_comprun function
# - The first argument to the function is the name of the command.
# - You should make sure to pass the rest of the arguments to fzf.
_fzf_comprun() {
local command=$1
shift
case "$command" in
cd) fzf --preview 'eza --tree --color=always {} | head -200' "$@" ;;
export|unset) fzf --preview "eval 'echo \${}'" "$@" ;;
ssh) fzf --preview 'dig {}' "$@" ;;
*) fzf --preview "$show_file_or_dir_preview" "$@" ;;
esac
}
Thanks for the feedback!
❤️ works very smooth now.. thank you so much!!! very fast resp!!! 🙌
earn a lifetime subscriber on both gh and yt 😍
That means a lot! Love the change on my setup too. Thanks again!!
Getting an error
[bat error]: 'folder' is a directory.
when viewing a folder and not showing folder contents like said on the video tutorial made when usingcd **