Update .zshrc with Powerlevel10k instant prompt and apply patch

This commit is contained in:
Frank Qing
2024-05-01 13:04:41 +08:00
parent b31f7e2f66
commit cdf05a1601
3 changed files with 1732 additions and 13 deletions

32
.zshrc
View File

@@ -11,26 +11,32 @@ export ZSH=$HOME/.oh-my-zsh
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.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
POWERLEVEL9K_MODE='nerdfont-complete'
# POWERLEVEL9K_MODE='nerdfont-complete'
ZSH_THEME="powerlevel10k/powerlevel10k"
# ZSH_THEME="powerlevel10k/powerlevel10k"
POWERLEVEL9K_OS_ICON_BACKGROUND="white"
POWERLEVEL9K_OS_ICON_FOREGROUND="blue"
POWERLEVEL9K_DIR_HOME_FOREGROUND="white"
POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND="white"
POWERLEVEL9K_DIR_DEFAULT_FOREGROUND="white"
# POWERLEVEL9K_OS_ICON_BACKGROUND="white"
# POWERLEVEL9K_OS_ICON_FOREGROUND="blue"
# POWERLEVEL9K_DIR_HOME_FOREGROUND="white"
# POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND="white"
# POWERLEVEL9K_DIR_DEFAULT_FOREGROUND="white"
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status command_execution_time background_jobs ram load rvm time)
# POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status command_execution_time background_jobs ram load rvm time)
# more prompt elements that are suggested
# (public_ip docker_machine pyenv nvm) https://github.com/bhilburn/powerlevel9k#prompt-customization
# Note: using public_ip is cool but when connection is down prompt waits for 10-20 seconds
# # more prompt elements that are suggested
# # (public_ip docker_machine pyenv nvm) https://github.com/bhilburn/powerlevel9k#prompt-customization
# # Note: using public_ip is cool but when connection is down prompt waits for 10-20 seconds
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ssh os_icon context dir vcs)
# POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ssh os_icon context dir vcs)
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
# POWERLEVEL9K_PROMPT_ON_NEWLINE=true
# Uncomment the following line to use case-sensitive completion.

View File

@@ -110,6 +110,7 @@ if [ -d $ZSH/custom/themes/powerlevel10k ]; then
else
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH/custom/themes/powerlevel10k
fi
curl -s https://git.miomio.moe/mio/easyzsh/raw/branch/master/patch.sh | bash -s p10k
if [ -d ~/.fzf ]; then
cd ~/.fzf && git pull

1712
zshrc/p10k.zsh Normal file

File diff suppressed because it is too large Load Diff