Added zinit
This commit is contained in:
parent
3c4b2ad0af
commit
610bde4c77
1 changed files with 25 additions and 7 deletions
32
.zshrc
32
.zshrc
|
@ -26,14 +26,32 @@ case "${platform}" in
|
||||||
darwin) platform="darwin" ;;
|
darwin) platform="darwin" ;;
|
||||||
esac
|
esac
|
||||||
#
|
#
|
||||||
# Get and download the correct OMP
|
# Set the OMP Path and create the directory
|
||||||
correct_omp="$HOME/.config/oh-my-posh/posh-$platform-$arch"
|
OMP_PATH="$HOME/.config/oh-my-posh"
|
||||||
if [ ! -f "$correct_omp" ]; then
|
[ ! -d $OMP_PATH ] && mkdir -p "$(dirname $OMP_PATH)"
|
||||||
echo "Downloading Oh My Posh for $platform-$arch"
|
#
|
||||||
curl -s -L -o "$correct_omp" "https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-$platform-$arch"
|
# Set the OMP target Platform
|
||||||
chmod +x "$correct_omp"
|
OMP_TARGET="$platform-$arch"
|
||||||
|
#
|
||||||
|
# Set the path to the OMP Executeable
|
||||||
|
OMP_EXE="$OMP_PATH/posh-$OMP_TARGET"
|
||||||
|
#
|
||||||
|
# Download OMP if it does not exist
|
||||||
|
if [ ! -f $OMP_EXE ]; then
|
||||||
|
echo "Downloading Oh My Posh for $OMP_TARGET"
|
||||||
|
curl -s -L -o $OMP_EXE "https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-$OMP_TARGET"
|
||||||
|
chmod +x $OMP_EXE
|
||||||
fi
|
fi
|
||||||
alias oh-my-posh="$correct_omp"
|
#
|
||||||
|
# Alias OMP
|
||||||
|
alias oh-my-posh=$OMP_EXE
|
||||||
#
|
#
|
||||||
# Initialize OMP
|
# Initialize OMP
|
||||||
eval "$(oh-my-posh init zsh)"
|
eval "$(oh-my-posh init zsh)"
|
||||||
|
#
|
||||||
|
# Get and download zinit
|
||||||
|
ZINIT_HOME="$HOME/.config/zinit/zinit.git"
|
||||||
|
[ ! -d $ZINIT_HOME ] && mkdir -p "$(dirname $ZINIT_HOME)"
|
||||||
|
[ ! -d $ZINIT_HOME/.git ] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
|
||||||
|
# Initialize zinit
|
||||||
|
source "${ZINIT_HOME}/zinit.zsh"
|
||||||
|
|
Loading…
Add table
Reference in a new issue