zsh:fzf-tab: Limit dir previews to a depth of 3

Otherwise this is way to performance heavy in large directories.
This commit is contained in:
2021-02-17 02:56:08 +01:00
parent 2700063ac1
commit 754adc9cf7

View File

@@ -6,7 +6,7 @@ zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
# Preview files and folders # Preview files and folders
# NOTE: Find out more about current context with <c-x>h # NOTE: Find out more about current context with <c-x>h
(( $+commands[bat] )) && file_prev_cmd="bat --color=always" || file_prev_cmd=cat (( $+commands[bat] )) && file_prev_cmd="bat --color=always" || file_prev_cmd=cat
(( $+commands[tree] )) && dir_prev_cmd="tree -C" || dir_prev_cmd=ls (( $+commands[tree] )) && dir_prev_cmd="tree -C -L 3" || dir_prev_cmd=ls
read -r -d '' preview_cmd <<EOT read -r -d '' preview_cmd <<EOT
[[ -d \$realpath ]] && $dir_prev_cmd \$realpath || $file_prev_cmd \$realpath [[ -d \$realpath ]] && $dir_prev_cmd \$realpath || $file_prev_cmd \$realpath
EOT EOT