# —————————————————————————————————————————————————————————————————————————————— # fzf configuration # # See https://github.com/junegunn/fzf # —————————————————————————————————————————————————————————————————————————————— fzf_default_usage='Alt+Y copy to clipboard Alt+/ move/hide preview' fzf_ctrl_t_usage='Ctrl+Y select Alt+Y copy to clipboard Alt+/ move/hide preview' fzf_ctrl_r_usage='Alt+R show surrounding entries Ctrl+R sort by relevance/recency Alt+Y copy to clipboard' fzf_alt_c_usage='Alt+Y copy to clipboard Alt+/ move/hide preview' # This is used by the Ctrl+T, Ctrl+R, and Alt+C bindings, unless redefined export FZF_DEFAULT_OPTS=" --walker file,dir,follow,hidden --walker-skip .git,node_modules --bind tab:down,btab:up --bind 'alt-y:execute-silent(wl-copy {..})+abort' --bind 'alt-/:change-preview-window(down|hidden|)' --bind 'ctrl-n:preview-half-page-down,ctrl-p:preview-half-page-up' --layout reverse --height 50% --color header:italic --footer '$fzf_default_usage' " # —————————————————————————————————————————————————————————————————————————————— # Ctrl+T, Ctrl+R, Alt+C function options # # See https://github.com/junegunn/fzf#key-bindings-for-command-line # —————————————————————————————————————————————————————————————————————————————— # (Ctrl+T) Paste the selected files and directories onto the command-line export FZF_CTRL_T_OPTS=" --walker file,follow,hidden --preview 'bat --number --color=always {}' --bind ctrl-y:toggle --bind 'alt-/:change-preview-window(down|hidden|)' --footer '$fzf_ctrl_t_usage' " # (Ctrl+R) Paste the selected command from history onto the command-line export FZF_CTRL_R_OPTS=" --bind 'alt-y:execute-silent(wl-copy {2..})+abort' --footer '$fzf_ctrl_r_usage' " # (Alt+C) `cd` into the selected directory export FZF_ALT_C_OPTS=" --walker dir,follow,hidden --preview 'tree -C {}' --bind 'alt-/:change-preview-window(down|hidden|)' --footer '$fzf_alt_c_usage' " eval "$(fzf --bash)"