Fix zsh-autosuggestions plugin location on macOS.

This commit is contained in:
Stanislav Nikitin 2021-08-22 15:34:20 +05:00
parent 8140b2087e
commit 8d0924d5f6
Signed by: pztrn
GPG Key ID: 1E944A0F0568B550
3 changed files with 6 additions and 2 deletions

View File

@ -3,6 +3,7 @@
OS=`uname`
OS_RELEASE=`uname -r`
OS_ARCH=`uname -m`
# Distro detection.
LSBRELEASE=$(which lsb_release)

View File

@ -96,7 +96,7 @@ case "${TERM}" in
bindkey '\e[1~' beginning-of-line # home
bindkey '\e[4~' end-of-line # end
;;
screen)
screen*)
bindkey '^[[1~' beginning-of-line # home
bindkey '^[[4~' end-of-line # end
bindkey '\e[3~' delete-char # delete
@ -104,5 +104,7 @@ case "${TERM}" in
bindkey '\eOd' backward-word # ctrl left
bindkey '^[[1;5C' forward-word # ctrl right
bindkey '^[[1;5D' backward-word # ctrl left
bindkey '^[[1;3C' forward-word # alt right
bindkey '^[[1;3D' backward-word # alt left
;;
esac

View File

@ -2,7 +2,8 @@ AUTOSUGGESTIONS_PATH=""
if [ "${DISTRO}" = "Arch" ]; then AUTOSUGGESTIONS_PATH="/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"; fi
if [ "${DISTRO}" = "Debian" ]; then AUTOSUGGESTIONS_PATH="/usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh"; fi
if [ "${DISTRO}" = "Darwin" ]; then AUTOSUGGESTIONS_PATH="/usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh"; fi
if [ "${DISTRO}" = "Darwin" -a "${OS_ARCH}" == "arm64" ]; then AUTOSUGGESTIONS_PATH="/opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh"; fi
if [ "${DISTRO}" = "Darwin" -a "${OS_ARCH}" == "x86_64" ]; then AUTOSUGGESTIONS_PATH="/usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh"; fi
if [ "${DISTRO}" = "Ubuntu" ]; then AUTOSUGGESTIONS_PATH="/usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh"; fi
if [ "${DISTRO}" = "VoidLinux" ]; then AUTOSUGGESTIONS_PATH="/usr/share/zsh/plugins/zsh-autosuggestions.zsh"; fi