From e41eb7bd4bc405a038e3a5ad5d135fff98ebd538 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Sat, 15 Oct 2022 14:49:24 -0500 Subject: make dots dynamic Signed-off-by: Matt Strapp --- zsh/.config/zsh/.zshrc | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'zsh') diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index f9e742c..d35ccd3 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -3,16 +3,14 @@ # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.config/zsh/.zshrc. # Initialization code that may require console input (password prompts, [y/n] # confirmations, etc.) must go above this block; everything else may go below. -if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" -fi +[[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]] && source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" eval "$(antidot init)" eval "$(lesspipe.sh)" # Luke's config for the Zoomer Shell -source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme +[ -f /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme ] && source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme || source ${XDG_DATA_HOME:-$HOME/.local/share}/powerlevel10k/powerlevel10k.zsh-theme # Enable colors and change prompt: autoload -U colors && colors # Load colors @@ -45,8 +43,6 @@ _comp_options+=(globdots) # Include hidden files. [[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh [[ ! -f ~/.config/zsh/keybindings.zsh ]] || source ~/.config/zsh/keybindings.zsh -#source /usr/share/nvm/init-nvm.sh - # zsh parameter completion for the dotnet CLI _dotnet_zsh_complete() @@ -58,6 +54,23 @@ _dotnet_zsh_complete() compctl -K _dotnet_zsh_complete dotnet -# Load syntax highlighting; should be last. -source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh -source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh 2>/dev/null \ No newline at end of file +if [ -f /etc/os-release ] +then + . /etc/os-release +else + echo "/etc/os-release not found." +fi + +case "$ID" in + debian | ubuntu ) + source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh + source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh + ;; + arch ) + source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh + source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh + ;; + * ) + echo "no highlight for you" + ;; +esac \ No newline at end of file -- cgit v1.2.3