diff --git a/.zshrc b/.zshrc index 845581a..9639d3c 100644 --- a/.zshrc +++ b/.zshrc @@ -171,6 +171,21 @@ bindkey '^xe' edit-command-line if iscmd fzf; then source <(fzf --zsh); + export FZF_CTRL_R_OPTS=" + --preview 'echo {}' --preview-window up:3:hidden:wrap + --bind 'ctrl-/:toggle-preview' + --bind 'ctrl-y:execute-silent(echo -n {2..} | pbcopy)+abort' + --color header:italic + --header 'Press CTRL-Y to copy command into clipboard'" + # Preview file content using bat (https://github.com/sharkdp/bat) + export FZF_CTRL_T_OPTS=" + --walker-skip .git,node_modules,target + --preview 'bat -n --color=always {}' + --bind 'ctrl-/:change-preview-window(down|hidden|)'" + # Print tree structure in the preview window + export FZF_ALT_C_OPTS=" + --walker-skip .git,node_modules,target + --preview 'tree -C {}'" fi if iscmd zoxide; then