From 8d0924d5f66ad9a64e0ca0da3f6cf9aa74509643 Mon Sep 17 00:00:00 2001 From: "Stanislav N. aka pztrn" Date: Sun, 22 Aug 2021 15:34:20 +0500 Subject: [PATCH] Fix zsh-autosuggestions plugin location on macOS. --- zsh/03-vars.zsh | 1 + zsh/30-keys.zsh | 4 +++- zsh/plugins/autosuggestions.plugin.zsh | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/zsh/03-vars.zsh b/zsh/03-vars.zsh index b98a619..7c0e48c 100644 --- a/zsh/03-vars.zsh +++ b/zsh/03-vars.zsh @@ -3,6 +3,7 @@ OS=`uname` OS_RELEASE=`uname -r` +OS_ARCH=`uname -m` # Distro detection. LSBRELEASE=$(which lsb_release) diff --git a/zsh/30-keys.zsh b/zsh/30-keys.zsh index 8534e33..c2430e7 100644 --- a/zsh/30-keys.zsh +++ b/zsh/30-keys.zsh @@ -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 diff --git a/zsh/plugins/autosuggestions.plugin.zsh b/zsh/plugins/autosuggestions.plugin.zsh index ec7f1bb..7e72312 100644 --- a/zsh/plugins/autosuggestions.plugin.zsh +++ b/zsh/plugins/autosuggestions.plugin.zsh @@ -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