zsh: use p10k for prompt with transient prompt
This commit is contained in:
parent
0b405b354a
commit
09e2c2e0fd
2 changed files with 1736 additions and 2 deletions
15
.zshrc
15
.zshrc
|
@ -1,3 +1,10 @@
|
||||||
|
# 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
|
||||||
|
|
||||||
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
|
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
|
||||||
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
|
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
|
||||||
command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
|
command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
|
||||||
|
@ -20,6 +27,7 @@ zi ice wait lucid
|
||||||
zi load olets/zsh-abbr
|
zi load olets/zsh-abbr
|
||||||
zi ice wait lucid
|
zi ice wait lucid
|
||||||
zi snippet https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/plugins/shrink-path/shrink-path.plugin.zsh
|
zi snippet https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/plugins/shrink-path/shrink-path.plugin.zsh
|
||||||
|
zinit ice depth=1; zinit light romkatv/powerlevel10k
|
||||||
|
|
||||||
zstyle ':completion:*' use-cache on
|
zstyle ':completion:*' use-cache on
|
||||||
zstyle ':completion:*' cache-path ~/.zsh/cache
|
zstyle ':completion:*' cache-path ~/.zsh/cache
|
||||||
|
@ -137,8 +145,8 @@ rg() {
|
||||||
|
|
||||||
|
|
||||||
## Prompt
|
## Prompt
|
||||||
setopt TRANSIENT_RPROMPT
|
# setopt TRANSIENT_RPROMPT
|
||||||
eval "$(starship init zsh)"
|
# eval "$(starship init zsh)"
|
||||||
|
|
||||||
## vim
|
## vim
|
||||||
export EDITOR=nvim
|
export EDITOR=nvim
|
||||||
|
@ -266,3 +274,6 @@ compdef _grc grc
|
||||||
|
|
||||||
# Atuin history
|
# Atuin history
|
||||||
eval "$(atuin init zsh)"
|
eval "$(atuin init zsh)"
|
||||||
|
|
||||||
|
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
||||||
|
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
||||||
|
|
Loading…
Reference in a new issue