forked from ohmyzsh/ohmyzsh
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add zsh-theme with username path and clean/dirty git repo
- Loading branch information
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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]" |