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
39
shell/fzf.sh
39
shell/fzf.sh
|
|
@ -1,35 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Arch
|
||||
if [ "${BASH_VERSION}" ] && [ -r /usr/share/fzf/key-bindings.bash ]; then
|
||||
if command -v fzf >/dev/null 2>&1; then
|
||||
if [ -n "${BASH_VERSION-}" ]; then
|
||||
# shellcheck source=/dev/null
|
||||
. /usr/share/fzf/key-bindings.bash
|
||||
eval "$(fzf --bash)"
|
||||
elif [ -n "${ZSH_VERSION-}" ]; then
|
||||
# shellcheck source=/dev/null
|
||||
source <(fzf --zsh)
|
||||
elif [ -n "${FISH_VERSION-}" ]; then
|
||||
# shellcheck source=/dev/null
|
||||
fzf --fish | source
|
||||
fi
|
||||
if [ "${BASH_VERSION}" ] && [ -r /usr/share/fzf/completion.bash ]; then
|
||||
# shellcheck source=/dev/null
|
||||
. /usr/share/fzf/completion.bash
|
||||
fi
|
||||
|
||||
if [ "${ZSH_VERSION}" ] && [ -r /usr/share/fzf/key-bindings.zsh ]; then
|
||||
# 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue