From c07a189fe5c1d0c39eb1db6d12613edd669d0d4b Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Thu, 30 Dec 2021 00:18:22 +0100 Subject: [PATCH] Alcune correzioni su zshrc. --- .zshrc | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/.zshrc b/.zshrc index 14b92ae..f79d319 100644 --- a/.zshrc +++ b/.zshrc @@ -1,14 +1,36 @@ # vim:sts=2:sw=2:ft=zsh -# Autocompletion -export FPATH=~/.dotfiles/zsh/functions:$FPATH +# Base directories for dotfiles. +export DOTFILES=~/.dotfiles -# Theme -source ~/.dotfiles/zsh/themes/gentoo.zsh.theme +# Enables base completion +autoload -Uz compinit +compinit + +# Autocompletion +export FPATH=$DOTFILES/zsh/functions:$FPATH # zsh packages from system -source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh -source /usr/share/zsh-syntax-highlighting/zsh-syntax-hightlighting.zsh +if uname -a | grep -qi 'debian'; then + # For Debian, it requires two packages + if [ -e /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then + source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh + fi + if [ -e /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then + source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh + fi + # + # Theme + source $DOTFILES/zsh/themes/gentoo.zsh-theme +elif uname -a | grep -qi '\(arch\|manjaro\)'; then + # Archlinux or manjaro + if [ -e /usr/share/zsh/manjaro-zsh-config ]; then + source /usr/share/zsh/manjaro-zsh-config + fi + if [ -e /usr/share/zsh/manjaro-zsh-prompt ]; then + source /usr/share/zsh/manjaro-zsh-prompt + fi +fi # Plugins source ~/.dotfiles/zsh/plugins/*.plugin.zsh