From c01c5fdd294c430907ebe12b472e183b49a8b48f Mon Sep 17 00:00:00 2001 From: Luna Komorebi Date: Fri, 7 Jun 2024 13:07:13 +0200 Subject: [PATCH] support more fzf commands --- .zshrc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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