fzf bugfixing

This commit is contained in:
pika 2024-08-18 03:10:55 +02:00
parent edb70380ec
commit a555be6c56

18
.bashrc
View file

@ -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