From c24691dc29a973e80d877fafafe26a7794b8b019 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Wed, 14 Jan 2026 12:50:40 +0100 Subject: zsh: Unterstütze bei den ZSH-Plugins Mac und FreeBSD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zsh/zshrc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/zsh/zshrc b/zsh/zshrc index d336bfc..71b30ba 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -17,6 +17,11 @@ function chpwd() { done } +# Funktionen +function source_file() { + [[ ! -r "$1" ]] || source "$1" +} + # Optionen setopt AUTO_PARAM_SLASH unsetopt CASE_GLOB @@ -25,9 +30,18 @@ setopt INC_APPEND_HISTORY setopt SHARE_HISTORY setopt HIST_IGNORE_ALL_DUPS -[[ ! -r /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]] || source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -[[ ! -r /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]] || source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh -[[ ! -r "$HOME/.opam/opam-init/init.zsh" ]] || source "$HOME/.opam/opam-init/init.zsh" +source_file "$HOME/.opam/opam-init/init.zsh" + +case "$OSTYPE" in + darwin*) + source_file "/opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" + source_file "/opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh" + ;; + freebsd*) + source_file "/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" + source_file "/usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh" + ;; +esac bindkey -v export KEYTIMEOUT=1 -- cgit v1.3