From 514511f264603a01ec126ce7af40d0fc744f9659 Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Tue, 12 Mar 2019 00:55:50 +0100 Subject: bashrc: load fzf bindings/completions and configure it to use fd --- bashrc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bashrc b/bashrc index 99cc2d2..5fd174b 100644 --- a/bashrc +++ b/bashrc @@ -69,3 +69,13 @@ export GPG_TTY=$(tty) export MANPAGER="/bin/sh -c \"col -b -x | view -u ~/.vim/pager.vim -c 'set ft=man nomod nolist' -\"" export PERLDOC_PAGER=$MANPAGER + +# fzf +[ -f /usr/share/doc/fzf/examples/key-bindings.bash ] && source /usr/share/doc/fzf/examples/key-bindings.bash +[ -f /usr/share/bash-completion/completions/fzf ] && source /usr/share/bash-completion/completions/fzf +[ -x "$(command -v tree)" ] && export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -100'" +if [ -x "$(command -v fd)" ]; then + export FZF_DEFAULT_COMMAND='fd --type f --color=never' + export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" + export FZF_ALT_C_COMMAND='fd --type d . --color=never' +fi -- cgit v1.2.3