.shincludes/source/niceties
2024-02-05 14:08:12 +02:00

39 lines
1.3 KiB
Text

[ -z "${ID+x}" ] && source /etc/os-release
if [ "${ID}" = "arch" ] || [ "${ID_LIKE}" = "arch" ]; then
local PATHS=(
"/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
"/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"
"/usr/share/fzf/completion.zsh"
"/usr/share/fzf/key-bindings.zsh"
)
elif [ "${ID}" = "ubuntu" ] || [ "${ID}" = "debian" ] || [ "${ID_LIKE}" = "debian" ]; then
local PATHS=(
"/usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
"/usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
"/usr/share/doc/fzf/examples/completion.zsh"
"/usr/share/doc/fzf/examples/key-bindings.zsh"
)
elif [ "${ID}" = "fedora" ]; then
local PATHS=(
"/usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
"/usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
"/usr/share/fzf/shell/key-bindings.zsh"
)
else
local PATHS=(
"$HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
"$HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh"
"$HOME/.zsh/fzf/shell/completion.zsh"
"$HOME/.zsh/fzf/shell/key-bindings.zsh"
)
fi
for file in "${PATHS[@]}"; do
[ -f "$file" ] && source "$file"
done
ZSH_AUTOSUGGEST_MANUAL_REBIND=1 # performance boost
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=64
unset PATHS