mirror of
https://github.com/Stunkymonkey/dotfiles.git
synced 2026-01-29 01:13:01 +01:00
shell/fzf: update shell completion sourcing
This commit is contained in:
parent
5a4a148887
commit
1c9d2e7eba
1 changed files with 11 additions and 32 deletions
43
shell/fzf.sh
43
shell/fzf.sh
|
|
@ -1,35 +1,14 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Arch
|
if command -v fzf >/dev/null 2>&1; then
|
||||||
if [ "${BASH_VERSION}" ] && [ -r /usr/share/fzf/key-bindings.bash ]; then
|
if [ -n "${BASH_VERSION-}" ]; then
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
. /usr/share/fzf/key-bindings.bash
|
eval "$(fzf --bash)"
|
||||||
fi
|
elif [ -n "${ZSH_VERSION-}" ]; then
|
||||||
if [ "${BASH_VERSION}" ] && [ -r /usr/share/fzf/completion.bash ]; then
|
# shellcheck source=/dev/null
|
||||||
# shellcheck source=/dev/null
|
source <(fzf --zsh)
|
||||||
. /usr/share/fzf/completion.bash
|
elif [ -n "${FISH_VERSION-}" ]; then
|
||||||
fi
|
# shellcheck source=/dev/null
|
||||||
|
fzf --fish | source
|
||||||
if [ "${ZSH_VERSION}" ] && [ -r /usr/share/fzf/key-bindings.zsh ]; then
|
fi
|
||||||
# shellcheck source=/dev/null
|
|
||||||
. /usr/share/fzf/key-bindings.zsh
|
|
||||||
fi
|
|
||||||
if [ "${ZSH_VERSION}" ] && [ -r /usr/share/fzf/completion.zsh ]; then
|
|
||||||
# shellcheck source=/dev/null
|
|
||||||
. /usr/share/fzf/completion.zsh
|
|
||||||
fi
|
|
||||||
|
|
||||||
# NixOS
|
|
||||||
if [ "${BASH_VERSION}" ] && command -v fzf-share >/dev/null; then
|
|
||||||
# shellcheck source=/dev/null
|
|
||||||
. "$(fzf-share)/key-bindings.bash"
|
|
||||||
# shellcheck source=/dev/null
|
|
||||||
. "$(fzf-share)/completion.bash"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${ZSH_VERSION}" ] && command -v fzf-share >/dev/null; then
|
|
||||||
# shellcheck source=/dev/null
|
|
||||||
. "$(fzf-share)/key-bindings.zsh"
|
|
||||||
# shellcheck source=/dev/null
|
|
||||||
. "$(fzf-share)/completion.zsh"
|
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue