mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
added plain theme
This commit is contained in:
parent
757fa3314d
commit
62364c57e2
1 changed files with 23 additions and 0 deletions
23
themes/plain.zsh-theme
Normal file
23
themes/plain.zsh-theme
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
PROMPT='%n@%m %~$(check_git_prompt_info)$ %{$reset_color%}'
|
||||||
|
|
||||||
|
local return_code="%(?..%{$fg[magenta]%}%? ↵%{$reset_color%})"
|
||||||
|
RPROMPT="${return_code}"
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}("
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}%{$fg[cyan]%})%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[cyan]%})%{$fg[blue]%}"
|
||||||
|
|
||||||
|
|
||||||
|
# Git sometimes goes into a detached head state. git_prompt_info doesn't
|
||||||
|
# return anything in this case. So wrap it in another function and check
|
||||||
|
# for an empty string. -- Brorrowed from Soliah.zsh-theme :)
|
||||||
|
function check_git_prompt_info() {
|
||||||
|
if git rev-parse --git-dir > /dev/null 2>&1; then
|
||||||
|
if [[ -z $(git_prompt_info) ]]; then
|
||||||
|
echo " %{$fg[cyan]%}(detached%{$fg[magenta]%}*%{$fg[cyan]%})%{$reset_color%}"
|
||||||
|
else
|
||||||
|
echo " $(git_prompt_info)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue