mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-09 02:24:03 +01:00
Add zsh-theme with username path and clean/dirty git repo
This commit is contained in:
parent
397c085a19
commit
db3f42df5c
1 changed files with 16 additions and 0 deletions
16
themes/ciop.zsh-theme
Normal file
16
themes/ciop.zsh-theme
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
function git_prompt_info() {
|
||||||
|
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
|
||||||
|
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_pwd() {
|
||||||
|
print -D $PWD
|
||||||
|
}
|
||||||
|
|
||||||
|
PROMPT=$'%{$fg[cyan]%}%m $fg[yellow]$(get_pwd) $(git_prompt_info)\
|
||||||
|
%{$fg[red]%}➜ %{$reset_color%} '
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="[git:"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="]$reset_color"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="$fg[red]+"
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN="$fg[green]"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue