diff --git a/.bashrc b/.bashrc index 6d1a5be..2b0c202 100644 --- a/.bashrc +++ b/.bashrc @@ -220,25 +220,21 @@ _cli_qol_() { } _fzf_(){ -# ─< Setup fzf >────────────────────────────────────────────────────────────────────────── -if [[ ! "$PATH" == */usr/share/doc/fzf/examples* ]]; then - export PATH="${PATH:+${PATH}:}/usr/share/doc/fzf/examples" -fi -# ─< Auto-completion >──────────────────────────────────────────────────────────────────── -[[ $- == *i* ]] && source "/usr/share/doc/fzf/examples/completion.bash" 2> /dev/null - -# ─< Key bindings >─────────────────────────────────────────────────────────────────────── # source /usr/share/doc/fzf/examples/completion.bash -if [ -f $HOME/.fzf.bash ]; then - source $HOME/.fzf.bash +if [ -f ~/.fzf.bash ]; then + . ~/.fzf.bash else - echo_error "fzf completion script not found" + echo_error "fzf completion script not found in ~/.fzf.bash" +fi +if [ -f /etc/bash_completion ]; then + . /etc/bash_completion fi source /usr/share/doc/fzf/examples/key-bindings.bash # ─< Use fzf for completion >───────────────────────────────────────────────────────────── bind -x '"\t": fzf-completion' bind -x '"\C-i": fzf-completion' } + _fzf_comprun() { local command=$1 shift