enable starship

This commit is contained in:
2025-04-27 13:20:55 +08:00
parent ed61157663
commit 6b41d832da
5 changed files with 201 additions and 14 deletions

5
zsh/config_starship.sh Normal file
View File

@@ -0,0 +1,5 @@
#! /bin/bash
current_dir=$(dirname "$0")
cp "$current_dir/../starship/starship.toml" "$HOME/.config/"

View File

@@ -27,6 +27,11 @@ if ! command -v python >/dev/null 2>&1; then
exit 1
fi
if ! command -v starship >/dev/null 2>&1; then
echo "Starship is not installed."
exit 1
fi
# Path
PATH_OHMYZSH="$HOME"/.oh-my-zsh
PATH_OHMYZSH_CUSTOM_PLUGINS="$PATH_OHMYZSH"/custom/plugins

View File

@@ -1,10 +1,3 @@
# 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 you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
@@ -117,9 +110,4 @@ source $ZSH/oh-my-zsh.sh
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=0
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=2
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_CONTENT_EXPANSION='${$((P9K_COMMAND_DURATION_SECONDS < 1 ? int(1000 * P9K_COMMAND_DURATION_SECONDS) : -1)):/-1/$P9K_CONTENT}${${$((P9K_COMMAND_DURATION_SECONDS < 1)):/1/ms}:/0/}'
eval "$(starship init zsh)"