diff --git a/.zshrc b/.zshrc index 1203b42..8d7b6e7 100644 --- a/.zshrc +++ b/.zshrc @@ -1,3 +1,10 @@ +# 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 + for S in \ 05-start \ 15-env \ @@ -20,4 +27,5 @@ do [ -e "$ZDOTDIR/$S.post.zsh" ] && source "$ZDOTDIR/$S.post.zsh" done -true +# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh. +[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh diff --git a/45-prompt.zsh b/45-prompt.zsh index 2de2418..81902a6 100644 --- a/45-prompt.zsh +++ b/45-prompt.zsh @@ -27,11 +27,11 @@ if [[ "$TERM_PROGRAM" == "Hyper" ]]; then SPACESHIP_GIT_BRANCH_SHOW=false fi -autoload is-at-least -if is-at-least "5.2" "$ZSH_VERSION"; then - ZSH_THEME="spaceship" +autoload -Uz is-at-least +if is-at-least "5.1" "$ZSH_VERSION"; then + ZSH_THEME="powerlevel10k" if [ ! -d "$ZSH_CUSTOM/themes/${ZSH_THEME}" ]; then - git clone https://github.com/spaceship-prompt/spaceship-prompt "$ZSH_CUSTOM/themes/${ZSH_THEME}" + git clone --depth=1 https://github.com/romkatv/powerlevel10k "$ZSH_CUSTOM/themes/${ZSH_THEME}" ln -s "${ZSH_CUSTOM}/themes/${ZSH_THEME}/${ZSH_THEME}.zsh-theme" "${ZSH_CUSTOM}/themes/${ZSH_THEME}.zsh-theme" fi else diff --git a/82-plugins.zsh b/82-plugins.zsh index 536070d..63a9acd 100644 --- a/82-plugins.zsh +++ b/82-plugins.zsh @@ -1,7 +1,7 @@ [ -e "$ZDOTDIR/12-functions.zsh" ] && source "$ZDOTDIR/12-functions.zsh" if [ ! -e "$ZSH/oh-my-zsh.sh" ]; then - git clone "https://github.com/ohmyzsh/ohmyzsh" "$ZSH" + git clone --depth=1 "https://github.com/ohmyzsh/ohmyzsh" "$ZSH" fi if [ ! -d "$ZSH_CUSTOM" ]; then