Created
February 28, 2020 00:52
-
-
Save tomjamescn/ccdcda091650ff1d34b496e4eeba123f to your computer and use it in GitHub Desktop.
custom oh-my-zsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ -z "$ZSH" ]]; then | |
echo "还未安装oh-my-zsh!" | |
exit 1 | |
fi | |
os=`uname` | |
cp "$ZSH/themes/robbyrussell.zsh-theme" "$ZSH/custom/themes/robbyrussell.zsh-theme" | |
if [ "$os" == "Darwin" ]; then | |
# mac os x的sed命令-i选项与Linux的不太一样 | |
sed -i '.bak' 's/^PROMPT.*$//' $ZSH/custom/themes/robbyrussell.zsh-theme 1>/dev/null | |
elif [ "$os" == "Linux" ]; then | |
sed -i 's/^PROMPT.*$//' $ZSH/custom/themes/robbyrussell.zsh-theme 1>/dev/null | |
else | |
echo "NOT SUPPORT OS:${os}" | |
exit 1 | |
fi | |
echo "" >> $ZSH/custom/themes/robbyrussell.zsh-theme | |
(cat <<EOF | |
PROMPT='%{\$fg_bold[white]%}%M %{\$fg_bold[red]%}➜ %{\$fg_bold[green]%}%p %{\$fg[cyan]%}%c %{\$fg_bold[blue]%}\$(git_prompt_info)%{\$fg_bold[blue]%} % %{\$reset_color%}' | |
#PROMPT='%(!.%{%F{yellow}%}.)\$USER @ %{\$fg[white]%}%M %{\$fg_bold[red]%}➜ %{\$fg_bold[green]%}%p %{\$fg[cyan]%}%c %{\$fg_bold[blue]%}\$(git_prompt_info)%{\$fg_bold[blue]%} % %{\$reset_color%}' | |
EOF | |
) >> $ZSH/custom/themes/robbyrussell.zsh-theme |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment